On 2/7/06, Amir Taaki <[EMAIL PROTECTED]> wrote:
> Thanks for your reply... ahh yes, did forget the implementation ;P
>
> The manual still uses the macro's, so where can I see an example of using the
> new template based scheme? It's not immediately obvious since all the old
> stuff uses the macro's.
>
> Would I just need to inherit scfImplementation<Object>, and then do
> Object::Object() : scfImplementation<Object>(this) {} ?
I didn't see a reply to your question on the list, but I may have just
missed it. Apologies if this is redundant.
If your class implements zero interfaces, you would need to inherit
from scfImplementation0<Object>, and do Object::Object() :
scfImplementationType(this) {} .
(For your convenience, scfImplementationType will be automatically
typedef to scfImplementation0<Object>.)
If your class implements one interface, you would need to inherit from
scfImplementation1<Object,Interface>, and do Object::Object() :
scfImplementationType(this) {}.
(In this case scfImplementationType is typedef
scfImplementation1<Object,Interface>.)
Etc.
If your class extends another SCF'ed class, Parent::Parent(arg1,arg2),
you would need to inherit from
scfImplementationExt1<Object,Parent,Interface>, and do
Object::Object() : scfImplementationType(this,arg1,arg2). You would
not inherit directly from Parent or call it's constructor, they will
be taken care of automatically by SCF. (BTW, Parent can be in either
new or old SCF format; they will both work.)
Etc.
I could go on to describe "advanced" SCF topics like custom IncRef()
implementations (Hint: you just define Object::IncRef()), but most
people don't need that and ... er I guess I just did.
Michael D. Adams
[EMAIL PROTECTED]
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]