Purpose:
|
Creates a history state on the specified history stream.
|
|
Derivation:
|
HISTORY_MANAGER : ACIS_OBJECT : -
|
|
Filename:
|
kern/kernel/sg_husk/history/history.hxx
|
|
Description:
|
Takes the bulletins in the current delta state and creates a history state on the specified history stream. The current delta is left with nothing in it. Returns the newly created history state. If the current delta state is empty (has no bulletins),
NULL is returned. When all is done, the current delta state is (optionally) cleared.
|
|
References:
|
by KERN
|
StreamFinder
|
|
|
|
Methods:
|
public: static DELTA_STATE*
|
|
|
HISTORY_MANAGER::acquireCurrentDelta (
|
|
|
HISTORY_STREAM*,
|
// history stream
|
|
|
logical clearDeltaState
|
// clear status
|
|
|
|
= TRUE
|
|
|
);
|
|
|
Takes the bulletins in the current delta state and creates a history state on the specified history stream. The current delta is left with nothing in it. Returns the newly created history state. If the current delta state is empty (has no bulletins),
NULL is returned. When all is done, the current delta state is (optionally) cleared.
|
|
|
|
|
|
|
public: static void HISTORY_MANAGER::changeToState
(
|
|
|
HISTORY_STREAM* pStream,
|
// source stream
|
|
|
DELTA_STATE* pTarget,
|
// target
|
|
|
int& statesChanged
|
// counter for rolling
|
|
|
|
|
// states
|
|
|
);
|
|
|
The state knows which stream it is in, so it does not need to be passed.
|
|
|
|
|
|
|
public: static outcome
|
|
|
HISTORY_MANAGER::checkDeltaForDistribute (
|
|
|
DELTA_STATE* pState,
|
|
// delta state
|
|
|
StreamFinder* pStreamFinder
|
// finds stream
|
|
|
);
|
|
|
Perform advance checks on a
DELTA_STATE to make sure it is OK to distribute it. Thus, problems can be detected before changing any of the data structure.
|
|
|
|
|
|
|
public: static void
|
|
|
HISTORY_MANAGER::clearCurrentDelta ();
|
|
|
Discards all the bulletins in the current delta state and clears it.
|
|
|
|
|
|
|
public: static int HISTORY_MANAGER::count_bulletins
(
|
|
|
DELTA_STATE* pState
|
// delta state
|
|
|
);
|
|
|
Gets the number of bulletins in the given delta state.
|
|
|
|
|
|
|
public: static void
|
|
|
HISTORY_MANAGER::debugCurrentDelta ();
|
|
|
Dumps bulletin board into current delta.
|
|
|
|
|
|
|
public: static void HISTORY_MANAGER::detach
(
|
|
|
ENTITY*
|
// entity
|
|
|
);
|
|
|
Detaches the given entity from any history stream it may be attached to. Strips the entity of the connecting attribute.
|
|
|
|
|
|
|
public: static outcome
|
|
|
HISTORY_MANAGER::distributeDeltaState (
|
|
|
DELTA_STATE* pState,
|
|
// delta state
|
|
|
StreamFinder* pStreamFinder,
|
// stream finder
|
|
|
logical clearDeltaState
|
|
// clear ds flag
|
|
|
|
= TRUE,
|
|
|
logical hideStates
|
|
// hide delta state
|
|
|
|
= FALSE
|
|
|
);
|
|
|
Takes the bulletins in the current delta state and "distributes" them onto history streams based on their "owning entities". Bulletins that do not belong to any entity that has a history stream attached to it are simple left in the current delta state. When all is done, the current delta state is (optionally) cleared.
|
|
|
|
|
|
|
public: static HISTORY_STREAM*
|
|
|
HISTORY_MANAGER::getAttachedStream (
|
|
|
ENTITY*
|
// entity
|
|
|
);
|
|
|
Gets the history stream attached to this entity, if any provided here to hide details of the connecting attribute.
|
|
|
|
|
|
|
public: static logical
|
|
|
HISTORY_MANAGER::isStateEmpty (
|
|
|
DELTA_STATE* pState
|
// delta_state
|
|
|
);
|
|
|
Tests for the existence of any BULLETINs in the given state.
|
|
|
|
|
|
|
public: static logical HISTORY_MANAGER::makeRootDS
(
|
|
|
DELTA_STATE* pState
|
// given pState
|
|
|
);
|
|
|
Makes the given pState the root delta state of the history stream it is a part of. States prior to the given pState are deleted. The effect is that one cannot roll back over the changes in that delta state. It is useful when initializing the system to prevent rolling back over the initialization. The toolkit uses it to prevent rolling back over
api_initialize_faceter.
|
|
|
|
|
|
|
public: static logical HISTORY_MANAGER::restore
(
|
|
|
HISTORY_STREAM*&,
|
// history stream
|
|
|
ENTITY**
|
// entity
|
|
|
);
|
|
|
Restores a history stream that was saved.
|
|
|
|
|
|
|
public: static int HISTORY_MANAGER::rollNStates
(
|
|
|
HISTORY_STREAM* pStream,
|
// history stream
|
|
|
int nstates
|
// number of states
|
|
|
);
|
|
|
Rolls a stream a given number of states or to the end of a branch, which ever comes first. Returns the number of states actually rolled.
|
|
|
|
|
|
|
public: static logical HISTORY_MANAGER::save
(
|
|
|
HISTORY_STREAM*,
|
// history stream list
|
|
|
ENTITY_LIST&,
|
// entity list
|
|
|
logical activeOnly
|
// active branch only
|
|
|
|
|
// if TRUE
|
|
|
);
|
|
|
Saves the history stream and associated entities.
|
|
|
|
|
|
|
public: static void HISTORY_MANAGER::setNewBulletin
(
|
|
|
BULLETIN* b,
|
// bulletin
|
|
|
ENTITY* n
|
// entity
|
|
|
);
|
|
|
Sets the given
BULLETIN to point to the given
ENTITY, and sets its next and previous pointers to
NULL.
|