#ifndef hello_H_ALREADY_INCLUDED #define hello_H_ALREADY_INCLUDED #include #include // Forward declaration of the context class (also known as graph) struct hello_context; // The step classes struct compute { int execute( const int & t, hello_context & c ) const; }; // The context class struct hello_context : public CnC::context< hello_context > { // Item collections CnC::item_collection< int, unsigned > hostid; CnC::item_collection< int, unsigned > threadid; // Tag collections CnC::tag_collection< int > tagvalue; // The context class constructor #pragma warning(push) #pragma warning(disable: 4355) hello_context() : CnC::context< hello_context >(), // Initialize each item collection hostid( this ), threadid( this ), // Initialize each tag collection tagvalue( this, true ) { // Prescriptive relations prescribe( tagvalue, compute() ); } #pragma warning(pop) }; #endif // hello_H_ALREADY_INCLUDED