89 @see DEFINE_CUSTOM_NODEACTIVITY |
89 @see DEFINE_CUSTOM_NODEACTIVITY |
90 */ |
90 */ |
91 #define DEFINE_EXPORT_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
91 #define DEFINE_EXPORT_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
92 EXPORT_C const MeshMachine::TNodeActivity& name :: Self() {return iSelf;} \ |
92 EXPORT_C const MeshMachine::TNodeActivity& name :: Self() {return iSelf;} \ |
93 EXPORT_C const NetStateMachine::TStateTriple& name :: FirstTriple() {return iData[1];} \ |
93 EXPORT_C const NetStateMachine::TStateTriple& name :: FirstTriple() {return iData[1];} \ |
94 const MeshMachine::TNodeActivity name :: iSelf = {id, msgtype::EId, msgtype::ERealm, name :: iData[1], &ctor, _S8(#name)}; \ |
94 const MeshMachine::TNodeActivity name :: iSelf = {id, 0, msgtype::EId, msgtype::ERealm, name :: iData[1], (TAny*)&ctor, _S8(#name)}; \ |
95 DEFINE_TRIPLES_TABLE( name :: iData ) |
95 DEFINE_TRIPLES_TABLE( name :: iData ) |
96 |
96 |
97 /** |
97 /** |
98 Define a custom node activity. A custom node activity is a node activity which defines its own |
98 Define a custom node activity. A custom node activity is a node activity which defines its own |
99 node activity class. This is used, for example, if the activity wishes to share some custom context |
99 node activity class. This is used, for example, if the activity wishes to share some custom context |
126 @see DEFINE_CUSTOM_NODEACTIVITY |
126 @see DEFINE_CUSTOM_NODEACTIVITY |
127 */ |
127 */ |
128 #define DEFINE_EXPORT_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
128 #define DEFINE_EXPORT_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
129 EXPORT_C const MeshMachine::TNodeActivity& name :: Self() {return iSelf;} \ |
129 EXPORT_C const MeshMachine::TNodeActivity& name :: Self() {return iSelf;} \ |
130 EXPORT_C const NetStateMachine::TStateTriple& name :: FirstTriple() {return iData[1];} \ |
130 EXPORT_C const NetStateMachine::TStateTriple& name :: FirstTriple() {return iData[1];} \ |
131 const MeshMachine::TNodeActivity name :: iSelf = {id, msgtype::EId, msgtype::ERealm, name :: iData[1], &ctor, NULL}; \ |
131 const MeshMachine::TNodeActivity name :: iSelf = {id, 0, msgtype::EId, msgtype::ERealm, name :: iData[1], (TAny*)&ctor, NULL}; \ |
132 DEFINE_TRIPLES_TABLE( name :: iData ) |
132 DEFINE_TRIPLES_TABLE( name :: iData ) |
133 |
133 |
134 /** |
134 /** |
135 Define a custom node activity. A custom node activity is a node activity which defines its own |
135 Define a custom node activity. A custom node activity is a node activity which defines its own |
136 node activity class. This is used, for example, if the activity wishes to share some custom context |
136 node activity class. This is used, for example, if the activity wishes to share some custom context |
415 NULL, \ |
415 NULL, \ |
416 NULL \ |
416 NULL \ |
417 }; |
417 }; |
418 |
418 |
419 /** |
419 /** |
|
420 RESERVED MACROS NOT TO BE USED. |
|
421 The following are new macro definitions allowing the context to be passed as a parameter rather than the node. |
|
422 In time the ability to pass context rather than node will be placed in the original macros. For the meantime, |
|
423 only critical commsFw activities which must have the context passed instead of the node should use these macros. |
|
424 All other activities should continue to use original macros declared above. |
|
425 */ |
|
426 /** |
|
427 Declare and export a node activity. |
|
428 |
|
429 @param name The name of the activity, which will be used to put it into the node's activity map |
|
430 |
|
431 @see DECLARE_NODEACTIVITY |
|
432 */ |
|
433 #define DECLARE_RESERVED_EXPORT_NODEACTIVITY( name ) \ |
|
434 struct name \ |
|
435 { \ |
|
436 IMPORT_C static const MeshMachine::TNodeActivity& Self(); \ |
|
437 IMPORT_C static const NetStateMachine::TStateTriple& FirstTriple(); \ |
|
438 static const MeshMachine::TNodeActivity iSelf; \ |
|
439 static const NetStateMachine::TStateTriple iData[]; \ |
|
440 }; |
|
441 |
|
442 /** |
|
443 Declares a node activity. A node activity is a state machine. It contains multiple nodeactivity |
|
444 entries, which respresent the states, transitions and forks of the state machine. |
|
445 |
|
446 @param name The name of the activity, which will be used to put it into the node's activity map |
|
447 |
|
448 @see DEFINE_NODEACTIVITY |
|
449 @see NODEACTIVITY_ENTRY |
|
450 */ |
|
451 #define DECLARE_RESERVED_NODEACTIVITY( name ) \ |
|
452 struct name \ |
|
453 { \ |
|
454 inline static const MeshMachine::TNodeActivity& Self() {return iSelf;} \ |
|
455 inline static const NetStateMachine::TStateTriple& FirstTriple() {return iData[1];} \ |
|
456 static const MeshMachine::TNodeActivity iSelf; \ |
|
457 static const NetStateMachine::TStateTriple iData[]; \ |
|
458 }; |
|
459 |
|
460 #ifdef SYMBIAN_TRACE_ENABLE |
|
461 |
|
462 /** |
|
463 Define a custom node activity. A custom node activity is a node activity which defines its own |
|
464 node activity class. This is used, for example, if the activity wishes to share some custom context |
|
465 information between the states and transition in the activity. |
|
466 |
|
467 Node activity class must derive from CNodeActivityBase. |
|
468 |
|
469 @param id Identifier for the activity |
|
470 @param name The name of the activity |
|
471 @param msgtype Message which will kickoff this activity |
|
472 @param ctor Constructor for the custom activity class |
|
473 |
|
474 @see DEFINE_RESERVED_NODEACTIVITY |
|
475 @see CNodeActivityBase |
|
476 |
|
477 */ |
|
478 #define DEFINE_RESERVED_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
|
479 const MeshMachine::TNodeActivity name :: iSelf = {id, 1, msgtype::EId, msgtype::ERealm, name :: iData[1], (TAny*)&ctor, _S8(#name)}; \ |
|
480 DEFINE_TRIPLES_TABLE( name :: iData ) |
|
481 |
|
482 #else |
|
483 |
|
484 /** |
|
485 Define and export a custom node activity. |
|
486 |
|
487 @param id Identifier for the activity |
|
488 @param name The name of the activity |
|
489 @param msgtype Message which will kickoff this activity |
|
490 @param ctor Constructor for the custom activity class |
|
491 |
|
492 @see DEFINE_RESERVED_CUSTOM_NODEACTIVITY |
|
493 */ |
|
494 #define DEFINE_RESERVED_EXPORT_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
|
495 EXPORT_C const MeshMachine::TNodeActivity& name :: Self() {return iSelf;} \ |
|
496 EXPORT_C const NetStateMachine::TStateTriple& name :: FirstTriple() {return iData[1];} \ |
|
497 const MeshMachine::TNodeActivity name :: iSelf = {id, 1, msgtype::EId, msgtype::ERealm, name :: iData[1], (TAny*)&ctor, NULL}; \ |
|
498 DEFINE_TRIPLES_TABLE( name :: iData ) |
|
499 |
|
500 /** |
|
501 Define a custom node activity. A custom node activity is a node activity which defines its own |
|
502 node activity class. This is used, for example, if the activity wishes to share some custom context |
|
503 information between the states and transition in the activity. |
|
504 |
|
505 Node activity class must derive from CNodeActivityBase. |
|
506 |
|
507 @param id Identifier for the activity |
|
508 @param name The name of the activity |
|
509 @param msgtype Message which will kickoff this activity |
|
510 @param ctor Constructor for the custom activity class |
|
511 |
|
512 @see DEFINE_RESERVED_NODEACTIVITY |
|
513 @see CNodeActivityBase |
|
514 */ |
|
515 #define DEFINE_RESERVED_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
|
516 const MeshMachine::TNodeActivity name :: iSelf = {id, 1, msgtype::EId, msgtype::ERealm, name :: iData[1], (TAny*)&ctor, NULL}; \ |
|
517 DEFINE_TRIPLES_TABLE( name :: iData ) |
|
518 |
|
519 #endif |
|
520 |
|
521 /** |
|
522 Define and declare a custom node activity |
|
523 |
|
524 @param id Identifier for the activity |
|
525 @param name The name of the activity |
|
526 @param msgtype Message which will kickoff this activity |
|
527 @param ctor Constructor for the custom activity class |
|
528 |
|
529 @see DEFINE_RESERVED_CUSTOM_NODEACTIVITY |
|
530 */ |
|
531 #define DECLARE_DEFINE_RESERVED_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) \ |
|
532 DECLARE_RESERVED_NODEACTIVITY( name ) \ |
|
533 DEFINE_RESERVED_CUSTOM_NODEACTIVITY( id, name, msgtype, ctor ) |
|
534 |
|
535 /** |
|
536 END OF RESERVED MACROS |
|
537 */ |
|
538 |
|
539 /** |
420 Mark the end of an activity map. This macro should be used for an activity map based |
540 Mark the end of an activity map. This macro should be used for an activity map based |
421 on other activity maps. |
541 on other activity maps. |
422 |
542 |
423 @param name_space The namespace of the base map |
543 @param name_space The namespace of the base map |
424 @param base_map The name of the base map |
544 @param base_map The name of the base map |
844 For use by custom activity NewLs to generate the unique part of the activity id. |
965 For use by custom activity NewLs to generate the unique part of the activity id. |
845 @param aActivitySig Context information about how the activity is to be started |
966 @param aActivitySig Context information about how the activity is to be started |
846 @param aNode The node to which this activity will belong. |
967 @param aNode The node to which this activity will belong. |
847 @return Generated unique component of activity id |
968 @return Generated unique component of activity id |
848 */ |
969 */ |
849 IMPORT_C static TUint GetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode ); |
970 static TUint GetNextActivityCountL( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode ); |
|
971 /** |
|
972 For use by custom activity News to generate the unique part of the activity id. |
|
973 @param aActivitySig Context information about how the activity is to be started |
|
974 @param aNode The node to which this activity will belong. |
|
975 @return Generated unique component of activity id |
|
976 */ |
|
977 IMPORT_C static TUint GetNextActivityCount( const TNodeActivity& aActivitySig, const AMMNodeBase& aNode ); |
850 |
978 |
851 /** |
979 /** |
852 Constructor for CNodeParallelActivityBase |
980 Constructor for CNodeParallelActivityBase |
853 @param aActivitySig Context information about how the activity is to be started |
981 @param aActivitySig Context information about how the activity is to be started |
854 @param aNode The node to which this activity will belong. |
982 @param aNode The node to which this activity will belong. |