Purpose:
|
Retrieves a sequence of bulletin boards.
|
|
Derivation:
|
DELTA_STATE : ACIS_OBJECT : -
|
|
SAT Identifier:
|
"delta_state"
|
|
Filename:
|
kern/kernel/kerndata/bulletin/bulletin.hxx
|
|
Description:
|
This class returns 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
note_state. They are chained together in a singly-linked list beginning at
bb_ptr.
|
|
References:
|
KERN
|
BULLETIN_BOARD, DELTA_STATE_LIST, DELTA_STATE_user_data, HISTORY_STREAM
|
|
by KERN
|
BULLETIN_BOARD, HISTORY_MANAGER, HISTORY_STREAM
|
|
Data:
|
public BULLETIN_BOARD *bb_ptr;
|
|
Pointer to bulletin board.
|
|
|
public DELTA_STATE *next_ds;
|
|
A delta state whose from_state equals this to_state.
|
|
|
public DELTA_STATE *partner_ds;
|
|
Circular list of delta states with same from_state.
|
|
|
public DELTA_STATE *prev_ds;
|
|
The delta state whose to_state equals this from_state.
|
|
|
public DELTA_STATE* merged_with_ds;
|
|
The delta state this one merges into.
|
|
|
public DELTA_STATE_LIST* merged_states;
|
|
The delta states merged into this one.
|
|
|
public DELTA_STATE_user_data *user_data;
|
|
Pointer to optional application data attached to the
DELTA_STATE.
|
|
|
public HISTORY_STREAM *owner_stream;
|
|
Allows history stream to be found from delta state.
|
|
|
public STATE_ID from_state;
|
|
Previous modeler state.
|
|
|
public STATE_ID this_state;
|
|
Set when state is noted.
|
|
|
public STATE_ID to_state;
|
|
Next modeler state to change to.
|
|
|
public char *name_str;
|
|
Name string for the
DELTA_STATE.
|
|
|
public logical hidden;
|
|
Not counted for roll_n_states or max_states.
|
|
|
public logical rolls_back;
|
|
Delta records a backward change.
|
|
Constructor:
|
public: DELTA_STATE::DELTA_STATE
(
|
|
|
HISTORY_STREAM*
|
// history
|
|
|
|
= NULL
|
|
|
);
|
|
|
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
|
|
|
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.
|
|
|
|
|
Destructor:
|
public: DELTA_STATE::~DELTA_STATE
();
|
|
|
C++ destructor, deleting a
DELTA_STATE.(and their bulletins) that constitute the
DELTA_STATE.
|
|
|
|
Methods:
|
public: void DELTA_STATE::add
(
|
|
|
BULLETIN_BOARD*
|
// bulletin board
|
|
|
);
|
|
|
Adds a new bulletin board to this delta state.
|
|
|
|
|
|
|
public: logical DELTA_STATE::backward
() const;
|
|
|
Rolls the current state to the previous one in the
DELTA_STATE.
|
|
|
|
|
|
|
public: BULLETIN_BOARD* DELTA_STATE::bb
() const;
|
|
|
Returns the
bb_ptr.
|
|
|
|
|
|
|
public: void DELTA_STATE::clear_history_ptrs
();
|
|
|
Clear reference to this history from entities in the delta state.
|
|
|
|
|
|
|
public: void DELTA_STATE::compress
();
|
|
|
Performs compression on a given
DELTA_STATE.
|
|
|
|
|
|
|
public: void DELTA_STATE::debug
(
|
|
|
FILE*
|
// file name
|
|
|
|
= debug_file_ptr
|
|
|
) const;
|
|
|
Outputs information about the
DELTA_STATE to the debug file or to the specified file.
|
|
|
|
|
|
|
public: void DELTA_STATE::debug
(
|
|
|
int id,
|
// entity id
|
|
|
int level,
|
// entity level
|
|
|
FILE*
|
// file name
|
|
|
|
= debug_file_ptr
|
|
|
) const;
|
|
|
Outputs debug information about
DELTA_STATE to the debug file or to the specified file.
|
|
|
|
|
|
|
public: void DELTA_STATE::debug_list
(
|
|
|
DELTA_STATE_LIST& dslist,
|
// delta state
|
|
|
int id,
|
|
// id
|
|
|
int level,
|
|
// level in state
|
|
|
int ent_level
|
|
// entity level
|
|
|
|
= 0,
|
|
|
FILE*
|
|
// file name
|
|
|
|
= debug_file_ptr
|
|
|
);
|
|
|
Prints debugging information with annotation support. 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.
|
|
|
|
|
|
|
public: void DELTA_STATE::debug_list
(
|
|
|
DELTA_STATE_LIST& dslist,
|
// delta state
|
|
|
int level
|
|
// level in state
|
|
|
|
= 0,
|
|
|
FILE*
|
|
// file name
|
|
|
|
= debug_file_ptr
|
|
|
);
|
|
|
Aids in debugging the
DELTA_STATE.
|
|
|
|
|
|
|
public: void DELTA_STATE::find_bulletins
(
|
|
|
int type,
|
// entity type
|
|
|
int level,
|
// entity level
|
|
|
BULLETIN_LIST& blist
|
// bulletin list
|
|
|
) const;
|
|
|
Function for finding annotations. 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.
|
|
|
|
|
|
|
public: void DELTA_STATE::find_bulletins
(
|
|
|
is_function tester,
|
// test function
|
|
|
BULLETIN_LIST& blist
|
// bulletin list
|
|
|
) const;
|
|
|
Function for finding annotations. 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.
|
|
|
|
|
|
|
public: void DELTA_STATE::find_entities
(
|
|
|
enum ENTITY_TYPE,
|
// type of entity
|
|
|
ENTITY_LIST&
|
// entity list
|
|
|
);
|
|
|
Searches in entity list for a type of entity recorded in the bulletin.
|
|
|
|
|
|
|
public: logical DELTA_STATE::fix_pointers
(
|
|
|
ENTITY_ARRAY& elist,
|
|
// pointers to fix
|
|
|
HISTORY_STREAM_LIST& hslist,
|
// hist stream list
|
|
|
DELTA_STATE_LIST& dslist
|
|
// delta state list
|
|
|
);
|
|
|
The
fix_pointers method for each entity in the restore array is called, with the array as argument. 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.)
|
|
|
|
|
|
|
public: logical DELTA_STATE::forward
() const;
|
|
|
Rolls the current state to the next one in the
DELTA_STATE.
|
|
|
|
|
|
|
public: STATE_ID DELTA_STATE::from
() const;
|
|
|
Read only access to the originating
DELTA_STATE.
|
|
|
|
|
|
|
public: const char* DELTA_STATE::get_name
();
|
|
|
Returns a name string of the
DELTA_STATE.
|
|
|
|
|
|
|
public: DELTA_STATE_user_data*
|
|
|
DELTA_STATE::get_user_data ();
|
|
|
Returns the user data that was attached to the
DELTA_STATE.
|
|
|
|
|
|
|
public: logical DELTA_STATE::hide
(
|
|
|
logical h
|
// hidden or not
|
|
|
);
|
|
|
Hides the given
DELTA_STATE.
|
|
|
|
|
|
|
public: HISTORY_STREAM*
|
|
|
DELTA_STATE::history_stream ();
|
|
|
Returns the owner of the stream.
|
|
|
|
|
|
|
public: STATE_ID DELTA_STATE::id
() const;
|
|
|
Returns the
STATE_ID.
|
|
|
|
|
|
|
public: logical DELTA_STATE::is_empty
() const;
|
|
|
Returns true if the
DELTA_STATE contains no
BULLETINs.
|
|
|
|
|
|
|
public: logical DELTA_STATE::is_named
(
|
|
|
const char* n
|
// name of delta state
|
|
|
);
|
|
|
Returns the name of the delta state.
|
|
|
|
|
|
|
public: void DELTA_STATE::merge_next
();;
|
|
|
Merge with the next
DELTA_STATE, 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.
|
|
|
|
|
|
|
public: logical DELTA_STATE::mixed_streams
(
|
|
|
HISTORY_STREAM*& alternate_hs
|
// alternate
|
|
|
|
|
|
|
// stream
|
|
|
);
|
|
|
Checks for mixed history streams.
|
|
|
|
|
|
|
public: DELTA_STATE* DELTA_STATE::next
() const;
|
|
|
Returns the next
DELTA_STATE.
|
|
|
|
|
|
|
public: DELTA_STATE* DELTA_STATE::partner
() const;
|
|
|
Returns the partner
DELTA_STATE.
|
|
|
|
|
|
|
public: DELTA_STATE* DELTA_STATE::prev
() const;
|
|
|
Returns the previous
DELTA_STATE.
|
|
|
|
|
|
|
public: void DELTA_STATE::remove
(
|
|
|
BULLETIN_BOARD*
|
// bulletin board
|
|
|
);
|
|
|
Removes a new bulletin board from this delta state.
|
|
|
|
|
|
|
public: void DELTA_STATE::reset_history_on_delete
();
|
|
|
Reset the history stream on deletion.
|
|
|
|
|
|
|
public: logical DELTA_STATE::restore
();
|
|
|
Restores
DELTA_STATE to the state provided by a previous bulletin board.
|
|
|
read_int
|
This state
|
|
read_int
|
Rolls back to
|
|
read_int
|
hidden
|
|
read_pointer
|
Pointer to record in SAT file for Previous DELTA_STATE
|
|
read_pointer
|
Pointer to record in SAT file for Next DELTA_STATE
|
|
read_pointer
|
Pointer to record in SAT file for Partner DELTA_STATE
|
|
read_pointer
|
Pointer to record in SAT file for Merged with DELTA_STATE
|
|
read_pointer
|
Pointer to record in SAT file for Owner HISTORY_STREAM
|
|
read_string_or_null
|
Name string
|
|
if (read_int)
|
If there is at least one bulletin board, represented by a number 1
|
|
BULLETIN_BOARD::restore
|
Restore an individual bulletin board
|
|
while (read_int)
|
While there are more bulletin boards, represented by a number 1
|
|
|
BULLETIN_BOARD::restore
|
Restore an individual bulletin board
|
|
read_int
|
Number of merged states
|
|
if(num_merged_states != 0)
|
|
while(num_merged_states--)
|
|
|
read_pointer
|
Pointer to record in SAT file to the merged DELTA_STATE.
|
|
read_data
|
|
|
|
Read until terminator
|
|
|
|
|
|
|
public: void DELTA_STATE::roll
();
|
|
|
Rolls back over a complete delta state, inverting it so as to allow roll forward the next time.
|
|
|
|
|
|
|
public: void DELTA_STATE::scan
(
|
|
|
DELTA_STATE_LIST& dslist
|
// change state list
|
|
|
) const;
|
|
|
Adds connectees to the delta state list.
|
|
|
|
|
|
|
public: void DELTA_STATE::set_from
(
|
|
|
STATE_ID from_id
|
// state ID number
|
|
|
);
|
|
|
Sets the identification of the from
STATE_ID.
|
|
|
|
|
|
|
public: void DELTA_STATE::set_history_ptrs
();
|
|
|
Set history pointers.
|
|
|
|
|
|
|
public: void DELTA_STATE::set_name
(
|
|
|
const char* n
|
// name
|
|
|
);
|
|
|
Changes name of
DELTA_STATE.
|
|
|
|
|
|
|
public: void DELTA_STATE::set_to
(
|
|
|
STATE_ID to_id
|
// state ID number
|
|
|
);
|
|
|
Sets the identification of the
to_state to
STATE_ID.
|
|
|
|
|
|
|
public: void DELTA_STATE::set_user_data
(
|
|
|
DELTA_STATE_user_data* d
|
// pointer to data
|
|
|
);
|
|
|
Permits users to change user data in
DELTA_STATE.
|
|
|
|
|
|
|
public: int DELTA_STATE::size
(
|
|
|
logical include_backups
|
// include backups
|
|
|
|
= TRUE
|
// as part of size
|
|
|
) const;
|
|
|
Returns the size of the
DELTA_STATE.
|
|
|
|
|
|
|
public: STATE_ID DELTA_STATE::to
() const;
|
|
|
Read only access to the destination
DELTA_STATE.
|
|
Internal Use:
|
full_size
|
|
|
|
|
Related Fncs:
|
abort_bb, change_state, clear_rollback_ptrs, close_bulletin_board, current_bb, current_delta_state, debug_delta_state, delete_all_delta_states, delete_ds_branch, get_default_stream, initialize_delta_states, open_bulletin_board, release_bb, set_default_stream
|