All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

SPAkern Class DELTA_STATE

SPAbase.ACIS_OBJECT
  |
  +---DELTA_STATE
 

Usage: you must use this class as is. You should never derive it.


public class DELTA_STATE

Contains a sequence of bulletin boards.


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.

See also:
BULLETIN_BOARD


Constructor and Destructor Index


o DELTA_STATE(HISTORY_STREAM*)
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
o ~DELTA_STATE()
C++ destructor, deleting a DELTA_STATE and their bulletins,that constitute the DELTA_STATE.

Method Index


o add(BULLETIN_BOARD*)
Adds a new bulletin board to this delta state.
o backward()
Rolls the current state to the previous one in the DELTA_STATE.
o bb()
Returns the bb_ptr.
o clear_history_ptrs()
Clears reference to this history from entities in the delta state.
o compress()
Performs compression on a given DELTA_STATE.
o debug(FILE*)
Outputs debug information about DELTA_STATE to the debug file or to the specified file.
o debug(int,int,FILE*)
Outputs debug information about DELTA_STATE to the debug file or to the specified file.
o debug_list(DELTA_STATE_LIST&,int,FILE*)
Aids in debugging the DELTA_STATE.
o debug_list(DELTA_STATE_LIST&,int,int,int,FILE*)
Prints debugging information with annotation support.
o find_bulletins(int,int,BULLETIN_LIST&)
Function for finding annotations.
o find_bulletins(is_function,BULLETIN_LIST&)
Function for finding annotations.
o find_entities(enum ENTITY_TYPE,ENTITY_LIST&)
Searches in entity list for a type of entity recorded in the bulletin.
o fix_pointers(ENTITY_ARRAY&,HISTORY_STREAM_LIST&,DELTA_STATE_LIST&)
The fix_pointers method for each entity in the restore array is called, with the array as argument.
o forward()
Rolls the current state to the next one in the DELTA_STATE.
o from()
Read only access to the originating DELTA_STATE.
o get_name()
Returns a name string of the DELTA_STATE.
o get_user_data()
Returns the user data that was attached to the DELTA_STATE.
o hide(logical)
Hides the given DELTA_STATE.
o history_stream()
Returns the owner of the stream.
o id()
Returns the STATE_ID.
o is_empty()
Returns true if the DELTA_STATE contains no BULLETINs.
o is_named(char*)
Returns the name of the delta state.
o merge_next()
Merge with the next DELTA_STATE.
o mixed_streams(HISTORY_STREAM*&)
Checks for mixed history streams.
o next()
Returns the next DELTA_STATE.
o partner()
Returns the partner DELTA_STATE.
o prev()
Returns the previous DELTA_STATE.
o remove(BULLETIN_BOARD*)
Removes a new bulletin board from this delta state.
o reset_history_on_delete()
Reset the history stream on deletion.
o restore()
Restores DELTA_STATE to the state provided by a previous bulletin board.
o roll()
Rolls back over a complete delta state, inverting it so as to allow roll forward the next time.
o scan(DELTA_STATE_LIST&)
Adds connectees to the delta state list.
o set_from(STATE_ID)
Sets the identification of the from STATE_ID.
o set_history_ptrs()
Sets history pointers.
o set_name(char*)
Changes name of DELTA_STATE.
o set_to(STATE_ID)
Sets the identification of the to_state to STATE_ID.
o set_user_data(DELTA_STATE_user_data*)
Permits users to change user data in DELTA_STATE.
o size(logical)
Returns the size of the DELTA_STATE.
o to()
Read only access to the destination DELTA_STATE.

Data Member Index


o bb_ptr
Pointer to bulletin board.
o from_state
Previous modeler state.
o hidden
Not counted for roll_n_states or max_states.
o merged_states
The delta states merged into this one.
o merged_with_ds
The delta state this one merges into.
o name_str
Name string for the DELTA_STATE.
o next_ds
A delta state whose from_state equals this to_state.
o owner_stream
Allows history stream to be found from delta state.
o partner_ds
Circular list of delta states with same from_state.
o prev_ds
The delta state whose to_state equals this from_state.
o rolls_back
Delta records a backward change.
o this_state
Sets when state is noted.
o to_state
Next modeler state to change to.
o user_data
Pointer to optional application data attached to the DELTA_STATE.

Constructor and Destructor


o DELTA_STATE
public 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.

Parameters:
hist
history.
o ~DELTA_STATE
public ~DELTA_STATE()
C++ destructor, deleting a DELTA_STATE and their bulletins,that constitute the DELTA_STATE.

Methods


o add
public void add(BULLETIN_BOARD* bb)
Adds a new bulletin board to this delta state.

Parameters:
bb
bulletin board.
o backward
public logical backward()
Rolls the current state to the previous one in the DELTA_STATE.
o bb
public BULLETIN_BOARD * bb()
Returns the bb_ptr.
o clear_history_ptrs
public void clear_history_ptrs()
Clears reference to this history from entities in the delta state.
o compress
public void compress()
Performs compression on a given DELTA_STATE.
o debug
public void debug(FILE* fname= debug_file_ptr )const
Outputs debug information about DELTA_STATE to the debug file or to the specified file.

Parameters:
fname
file name.
o debug
public 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.

Parameters:
id
entity id.

level
entity level.

fname
file name.
o debug_list
public void debug_list(DELTA_STATE_LIST& dslist,
int level= 0,
FILE* fname= debug_file_ptr )
Aids in debugging the DELTA_STATE.

Parameters:
dslist
delta state.

level
level in state.

fname
file name.
o debug_list
public 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.

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.

Parameters:
dslist
delta state.

id
entity id.

level
level in state.

ent_level
entity level.

fname
file name.
o find_bulletins
public void 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.

Parameters:
type
entity type.

level
entity level.

blist
bulletin list.
o find_bulletins
public void find_bulletins(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.

Parameters:
tester
test function.

blist
bulletin list.
o find_entities
public void find_entities(enum ENTITY_TYPE type,
ENTITY_LIST& elist)
Searches in entity list for a type of entity recorded in the bulletin.

Parameters:
type
type of entity.

elist
entity list.
o fix_pointers
public 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.

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.)

Parameters:
elist
pointers to fix.

hslist
hist stream list.

dslist
delta state list.
o forward
public logical forward()
Rolls the current state to the next one in the DELTA_STATE.
o from
public STATE_ID from()
Read only access to the originating DELTA_STATE.
o get_name
public const char* get_name()
Returns a name string of the DELTA_STATE.
o get_user_data
public DELTA_STATE_user_data* get_user_data()
Returns the user data that was attached to the DELTA_STATE.
o hide
public logical hide(logical h)
Hides the given DELTA_STATE.

Parameters:
h
hide or not.
o history_stream
public HISTORY_STREAM* history_stream()
Returns the owner of the stream.
o id
public STATE_ID id()
Returns the STATE_ID.
o is_empty
public logical is_empty()const
Returns true if the DELTA_STATE contains no BULLETINs.
o is_named
public logical is_named( const char* n)
Returns the name of the delta state.

Parameters:
n
name of delta state.
o merge_next
public void 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.
o mixed_streams
public logical mixed_streams(HISTORY_STREAM*& alternate_hs)
Checks for mixed history streams.

Parameters:
alternate_hs
alternate stream.
o next
public DELTA_STATE * next()
Returns the next DELTA_STATE.
o partner
public DELTA_STATE * partner()
Returns the partner DELTA_STATE.
o prev
public DELTA_STATE * prev()
Returns the previous DELTA_STATE.
o remove
public void remove(BULLETIN_BOARD* bb)
Removes a new bulletin board from this delta state.

Parameters:
bb
bulletin board.
o reset_history_on_delete
public void reset_history_on_delete()
Reset the history stream on deletion.
o restore
public logical restore()
Restores DELTA_STATE to the state provided by a previous bulletin board.
o roll
public void roll()
Rolls back over a complete delta state, inverting it so as to allow roll forward the next time.
o scan
public void scan(DELTA_STATE_LIST& dslist)const
Adds connectees to the delta state list.

Parameters:
dslist
change state list.
o set_from
public void set_from(STATE_ID from_id)
Sets the identification of the from STATE_ID.
o set_history_ptrs
public void set_history_ptrs()
Sets history pointers.
o set_name
public void set_name( const char* n)
Changes name of DELTA_STATE.

Parameters:
n
name.
o set_to
public void set_to(STATE_ID to_id)
Sets the identification of the to_state to STATE_ID.

Parameters:
to_id
state ID number.
o set_user_data
public void set_user_data(DELTA_STATE_user_data* d)
Permits users to change user data in DELTA_STATE.

Parameters:
d
pointer to data.
o size
public int size(logical include_backups= TRUE) const
Returns the size of the DELTA_STATE.

Parameters:
include_backups
include backups as part of size.
o to
public STATE_ID to()
Read only access to the destination DELTA_STATE.

Data Members


o bb_ptr
  public BULLETIN_BOARD *bb_ptr
Pointer to bulletin board.
o from_state
  public STATE_ID from_state
Previous modeler state.
o hidden
  public logical hidden
Not counted for roll_n_states or max_states.
o merged_states
  public DELTA_STATE_LIST* merged_states
The delta states merged into this one.
o merged_with_ds
  public DELTA_STATE* merged_with_ds
The delta state this one merges into.
o name_str
  public char *name_str
Name string for the DELTA_STATE.
o next_ds
  public DELTA_STATE *next_ds
A delta state whose from_state equals this to_state.
o owner_stream
  public HISTORY_STREAM *owner_stream
Allows history stream to be found from delta state.
o partner_ds
  public DELTA_STATE *partner_ds
Circular list of delta states with same from_state.
o prev_ds
  public DELTA_STATE *prev_ds
The delta state whose to_state equals this from_state.
o rolls_back
  public logical rolls_back
Delta records a backward change.
o this_state
  public STATE_ID this_state
Sets when state is noted.
o to_state
  public STATE_ID to_state
Next modeler state to change to.
o user_data
  public DELTA_STATE_user_data *user_data
Pointer to optional application data attached to the DELTA_STATE.

This object is included in the file: bulletin.hxx

Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.