#include <bulletin.hxx>


Public Member Functions | |
| void | add (BULLETIN_BOARD *bb) |
| Adds a new bulletin board to this delta state. | |
| logical | backward () const |
Rolls the current state to the previous one in the DELTA_STATE. | |
| BULLETIN_BOARD * | bb () const |
Returns the bb_ptr. | |
| void | clear_history_ptrs () |
| Clears reference to this history from entities in the delta state. | |
| void | compress () |
Performs compression on a given DELTA_STATE. | |
| void | debug (int id, int level, FILE *fname=debug_file_ptr) const |
Outputs debug information about DELTA_STATE to the debug file or to the specified file. | |
| void | debug (FILE *fname=debug_file_ptr) const |
Outputs debug information about DELTA_STATE to the debug file or to the specified file. | |
| void | debug_list (DELTA_STATE_LIST &dslist, int id, int level, int ent_level=0, FILE *fname=debug_file_ptr) |
| Prints debugging information with annotation support. | |
| void | debug_list (DELTA_STATE_LIST &dslist, int level=0, FILE *fname=debug_file_ptr) |
Aids in debugging the DELTA_STATE. | |
| DELTA_STATE (HISTORY_STREAM *hist=NULL) | |
| C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments. | |
| void | find_bulletins (spa_is_function tester, BULLETIN_LIST &blist) const |
| Function for finding annotations. | |
| void | find_bulletins (int type, int level, BULLETIN_LIST &blist) const |
| Function for finding annotations. | |
| void | find_entities (enum ENTITY_TYPE type, ENTITY_LIST &elist) |
| Searches in entity list for a type of entity recorded in the bulletin. | |
| logical | fix_pointers (ENTITY_ARRAY &elist, HISTORY_STREAM_LIST &hslist, DELTA_STATE_LIST &dslist) |
The fix_pointers method for each entity in the restore array is called, with the array as argument. | |
| logical | forward () const |
Rolls the current state to the next one in the DELTA_STATE. | |
| STATE_ID | from () const |
Read only access to the originating DELTA_STATE. | |
| const char * | get_name () |
Returns a name string of the DELTA_STATE. | |
| DELTA_STATE_user_data * | get_user_data () |
Returns the user data that was attached to the DELTA_STATE. | |
| logical | hide (logical h) |
Hides the given DELTA_STATE. | |
| HISTORY_STREAM * | history_stream () |
| Returns the owner of the stream. | |
| STATE_ID | id () const |
Returns the STATE_ID. | |
| logical | is_empty () const |
Returns true if the DELTA_STATE contains no BULLETINs. | |
| logical | is_named (const char *n) |
| Returns the name of the delta state. | |
| void | merge_next () |
Merge with the next DELTA_STATE. | |
| logical | mixed_streams (HISTORY_STREAM *&alternate_hs) |
| Checks for mixed history streams. | |
| DELTA_STATE * | next () const |
Returns the next DELTA_STATE. | |
| DELTA_STATE * | partner () const |
Returns the partner DELTA_STATE. | |
| DELTA_STATE * | prev () const |
Returns the previous DELTA_STATE. | |
| void | remove (BULLETIN_BOARD *bb) |
| Removes a new bulletin board from this delta state. | |
| void | reset_history_on_delete () |
| Reset the history stream on deletion. | |
| logical | restore () |
Restores DELTA_STATE to the state provided by a previous bulletin board. | |
| void | roll () |
| Rolls back over a complete delta state, inverting it so as to allow roll forward the next time. | |
| void | scan (DELTA_STATE_LIST &dslist) const |
| Adds connectees to the delta state list. | |
| void | set_from (STATE_ID from_id) |
Sets the identification of the from STATE_ID. | |
| void | set_history_ptrs () |
| Sets history pointers. | |
| void | set_name (const char *n) |
Changes name of DELTA_STATE. | |
| void | set_to (STATE_ID to_id) |
Sets the identification of the to_state to STATE_ID. | |
| void | set_user_data (DELTA_STATE_user_data *d) |
Permits users to change user data in DELTA_STATE. | |
| int | size (logical include_backups=TRUE) const |
Returns the size of the DELTA_STATE. | |
| STATE_ID | to () const |
Read only access to the destination DELTA_STATE. | |
| ~DELTA_STATE () | |
C++ destructor, deleting a DELTA_STATE and their bulletins,that constitute the DELTA_STATE. | |
Public Attributes | |
| BULLETIN_BOARD * | bb_ptr |
| Pointer to bulletin board. | |
| STATE_ID | from_state |
| Previous modeler state. | |
| logical | hidden |
Not counted for roll_n_states or max_states. | |
| DELTA_STATE_LIST * | merged_states |
| The delta states merged into this one. | |
| DELTA_STATE * | merged_with_ds |
| The delta state this one merges into. | |
| char * | name_str |
Name string for the DELTA_STATE. | |
| DELTA_STATE * | next_ds |
A delta state whose from_state equals this to_state. | |
| HISTORY_STREAM * | owner_stream |
| Allows history stream to be found from delta state. | |
| DELTA_STATE * | partner_ds |
Circular list of delta states with same from_state. | |
| DELTA_STATE * | prev_ds |
The delta state whose to_state equals this from_state. | |
| logical | rolls_back |
| Delta records a backward change. | |
| STATE_ID | this_state |
| Sets when state is noted. | |
| STATE_ID | to_state |
| Next modeler state to change to. | |
| DELTA_STATE_user_data * | user_data |
Pointer to optional application data attached to the DELTA_STATE. | |
Role: This class contains a sequence of bulletin boards that change the modeler from the from_state to the to_state. The bulletin boards are created between successive calls to api_note_state. They are chained together in a singly-linked list beginning at bb_ptr.
| DELTA_STATE::DELTA_STATE | ( | HISTORY_STREAM * | hist = NULL |
) |
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
Role: Creates a new state, with the to_state set to the current state, the from_state set to 0, and the bb_ptr set to NULL.
| hist | history. |
| DELTA_STATE::~DELTA_STATE | ( | ) |
C++ destructor, deleting a DELTA_STATE and their bulletins,that constitute the DELTA_STATE.
| void DELTA_STATE::add | ( | BULLETIN_BOARD * | bb | ) |
Adds a new bulletin board to this delta state.
| bb | bulletin board. |
| logical DELTA_STATE::backward | ( | ) | const [inline] |
Rolls the current state to the previous one in the DELTA_STATE.
| BULLETIN_BOARD* DELTA_STATE::bb | ( | ) | const [inline] |
Returns the bb_ptr.
| void DELTA_STATE::clear_history_ptrs | ( | ) |
Clears reference to this history from entities in the delta state.
| void DELTA_STATE::compress | ( | ) |
Performs compression on a given DELTA_STATE.
| void DELTA_STATE::debug | ( | int | id, | |
| int | level, | |||
| FILE * | fname = debug_file_ptr | |||
| ) | const |
Outputs debug information about DELTA_STATE to the debug file or to the specified file.
| id | entity id. | |
| level | entity level. | |
| fname | file name. |
| void DELTA_STATE::debug | ( | FILE * | fname = debug_file_ptr |
) | const |
Outputs debug information about DELTA_STATE to the debug file or to the specified file.
| fname | file name. |
| void DELTA_STATE::debug_list | ( | DELTA_STATE_LIST & | dslist, | |
| int | id, | |||
| int | level, | |||
| int | ent_level = 0, |
|||
| FILE * | fname = debug_file_ptr | |||
| ) |
Prints debugging information with annotation support.
Role: The second and third arguments specify a branch of the entity derivation hierarchy to call debug_ent on, in addition to the normal bulletin board debugging information. For annotations we use ANNOTATION_TYPE and ANNOTATION_LEVEL.
| dslist | delta state. | |
| id | entity id. | |
| level | level in state. | |
| ent_level | entity level. | |
| fname | file name. |
| void DELTA_STATE::debug_list | ( | DELTA_STATE_LIST & | dslist, | |
| int | level = 0, |
|||
| FILE * | fname = debug_file_ptr | |||
| ) |
Aids in debugging the DELTA_STATE.
| dslist | delta state. | |
| level | level in state. | |
| fname | file name. |
| void DELTA_STATE::find_bulletins | ( | spa_is_function | tester, | |
| BULLETIN_LIST & | blist | |||
| ) | const |
Function for finding annotations.
Role: The first two arguments specify a branch of the entity derivation hierarchy to return bulletins for. In this form the tester identifies the type of entity to look for. For annotation use, we can use ANNOTATION_TYPE and ANNOTATION_LEVEL. It may also be useful to be more specific, such as SWEEP_ANNOTATION_TYPE and SWEEP_ANNOTATION_LEVEL. The is_XXXX functions generated by the ENTITY_DEF macro work well.
| tester | test function. | |
| blist | bulletin list. |
| void DELTA_STATE::find_bulletins | ( | int | type, | |
| int | level, | |||
| BULLETIN_LIST & | blist | |||
| ) | const |
Function for finding annotations.
Role: The first two arguments specify a branch of the entity derivation hierarchy to return bulletins for. For annotation use, we can use ANNOTATION_TYPE and ANNOTATION_LEVEL. It may also be useful to be more specific, such as SWEEP_ANNOTATION_TYPE and SWEEP_ANNOTATION_LEVEL. The is_XXXX functions generated by the ENTITY_DEF macro work well.
| type | entity type. | |
| level | entity level. | |
| blist | bulletin list. |
| void DELTA_STATE::find_entities | ( | enum ENTITY_TYPE | type, | |
| ENTITY_LIST & | elist | |||
| ) |
Searches in entity list for a type of entity recorded in the bulletin.
| type | type of entity. | |
| elist | entity list. |
| logical DELTA_STATE::fix_pointers | ( | ENTITY_ARRAY & | elist, | |
| HISTORY_STREAM_LIST & | hslist, | |||
| DELTA_STATE_LIST & | dslist | |||
| ) |
The fix_pointers method for each entity in the restore array is called, with the array as argument.
Role: This calls fix_common, which calls its parent's fix_common, and then corrects any pointers in the derived class. In practice there is never anything special for fix_pointers to do, but it is retained for consistency and compatibility. (Supplied by the ENTITY_FUNCTIONS and UTILITY_DEF macros.)
| elist | pointers to fix. | |
| hslist | hist stream list. | |
| dslist | delta state list. |
| logical DELTA_STATE::forward | ( | ) | const [inline] |
Rolls the current state to the next one in the DELTA_STATE.
| STATE_ID DELTA_STATE::from | ( | ) | const [inline] |
Read only access to the originating DELTA_STATE.
| const char* DELTA_STATE::get_name | ( | ) | [inline] |
Returns a name string of the DELTA_STATE.
| DELTA_STATE_user_data* DELTA_STATE::get_user_data | ( | ) | [inline] |
Returns the user data that was attached to the DELTA_STATE.
| logical DELTA_STATE::hide | ( | logical | h | ) | [inline] |
| HISTORY_STREAM* DELTA_STATE::history_stream | ( | ) | [inline] |
Returns the owner of the stream.
| STATE_ID DELTA_STATE::id | ( | ) | const [inline] |
Returns the STATE_ID.
| logical DELTA_STATE::is_empty | ( | ) | const |
Returns true if the DELTA_STATE contains no BULLETINs.
| logical DELTA_STATE::is_named | ( | const char * | n | ) |
Returns the name of the delta state.
| n | name of delta state. |
| void DELTA_STATE::merge_next | ( | ) |
Merge with the next DELTA_STATE.
Role: Keeping all the BULLETINs and BULLETIN_BOARDs from both states in the correct order in this state, and then deleting next. If the next state had partners, indicating a branch, the branch is pruned as there would no longer be a sensible way to roll the model to states on the branch. Repeated calls can be used to compress any linear range of delta states with the same roll direction, into one state.
| logical DELTA_STATE::mixed_streams | ( | HISTORY_STREAM *& | alternate_hs | ) |
Checks for mixed history streams.
| alternate_hs | alternate stream. |
| DELTA_STATE* DELTA_STATE::next | ( | ) | const [inline] |
Returns the next DELTA_STATE.
| DELTA_STATE* DELTA_STATE::partner | ( | ) | const [inline] |
Returns the partner DELTA_STATE.
| DELTA_STATE* DELTA_STATE::prev | ( | ) | const [inline] |
Returns the previous DELTA_STATE.
| void DELTA_STATE::remove | ( | BULLETIN_BOARD * | bb | ) |
Removes a new bulletin board from this delta state.
| bb | bulletin board. |
| void DELTA_STATE::reset_history_on_delete | ( | ) | [inline] |
Reset the history stream on deletion.
| logical DELTA_STATE::restore | ( | ) |
Restores DELTA_STATE to the state provided by a previous bulletin board.
| void DELTA_STATE::roll | ( | ) |
Rolls back over a complete delta state, inverting it so as to allow roll forward the next time.
| void DELTA_STATE::scan | ( | DELTA_STATE_LIST & | dslist | ) | const |
Adds connectees to the delta state list.
| dslist | change state list. |
| void DELTA_STATE::set_from | ( | STATE_ID | from_id | ) | [inline] |
Sets the identification of the from STATE_ID.
| void DELTA_STATE::set_history_ptrs | ( | ) |
Sets history pointers.
| void DELTA_STATE::set_name | ( | const char * | n | ) |
| void DELTA_STATE::set_to | ( | STATE_ID | to_id | ) | [inline] |
Sets the identification of the to_state to STATE_ID.
| to_id | state ID number. |
| void DELTA_STATE::set_user_data | ( | DELTA_STATE_user_data * | d | ) | [inline] |
| int DELTA_STATE::size | ( | logical | include_backups = TRUE |
) | const |
| STATE_ID DELTA_STATE::to | ( | ) | const [inline] |
Read only access to the destination DELTA_STATE.
Pointer to bulletin board.
Previous modeler state.
| logical DELTA_STATE::hidden |
Not counted for roll_n_states or max_states.
The delta states merged into this one.
The delta state this one merges into.
| char* DELTA_STATE::name_str |
Name string for the DELTA_STATE.
A delta state whose from_state equals this to_state.
Allows history stream to be found from delta state.
Circular list of delta states with same from_state.
The delta state whose to_state equals this from_state.
| logical DELTA_STATE::rolls_back |
Delta records a backward change.
Sets when state is noted.
Next modeler state to change to.
| DELTA_STATE_user_data* DELTA_STATE::user_data |
Pointer to optional application data attached to the DELTA_STATE.