ChasmImplementation


There are a few predefined areas for you to place your code in a Chasm generated file. These are described below. However, using supplementary files makes these areas explicit.

NOTE: These common areas to place code are almost exactly mimicked by supplemental header files.


Header Includes

This is the code at the top of a Chasm Concept .h file. It allows you to include files for the Concept's class definition. ex. "class cwList;"

Code File Includes

This is the code at the top of a Chasm Concept .h file. It allows you to include files for the Concept's class definition. ex. "#include <cwlib/cwList.h>"

Parameters:

These are for parameters supplied to the constructor and the Concept's parent constructor. NOTE: They are ALL comma separated and end with a comma!

Concept Header:

This code in placed in the declaration of the Concept class. You should put your public, private, or protected data members and function declaractions here. (MINUS the constructor and destructor!)

ex.

public:
     void setCount(int _c);
private:
     int Count;

Builder Header:

This code is placed in the declaration of the Concept's builder class. (need help here)

Concept Constructor:

Code which is placed in the constructor. This is also where you'll be using the parameters you defined above with CHASMCONCEPT_PARAMS_*.

Concept Destructor:

Code which is placed in the destructor. Make sure you clean up memory you used/trashed.

Builder Initialization

After the builder is constructed, this function is called right before the 'init' symbol is sent. If you have any component concepts in your concept this is where you want to make setComponent? function calls. (need help here)

Code File:

The normal implementation of the class. The normal implementation of methods for the Concept and its builder go here.

ex. (extended from the Concept Header above)

void setCount(int _c){
     Count = _c;
}

Also, don't forget to include implementation for the state entry functions (which are builder functions). Those are in the form of:

Symbol* CHASMCONCEPTBuilder::do_<state>(CO* _co) { }

NOTE: When using supplementary files be sure to replace CHASMCONCEPT with the name of the actual concept.

NOTE: If you need to access concept members in Builder functions, remember to use the DIRECTOR define. Alternatively, if you need to access Builder members from a concept function, use the BUILDER define.