BULLETIN
List of: Classes
Subjects: History and Roll, SAT Save and Restore
Contents: Kernel

Purpose: Describes the records that are chained into bulletin-boards.

Derivation: BULLETIN : ACIS_OBJECT : -

SAT Identifier: "bulletin"

Filename: kern/kernel/kerndata/bulletin/bulletin.hxx

Description: A bulletin has a type signifying the creation, change, or deletion of a model entity. The type is not stored, but deduced from the presence or absence of new and old entity pointers. Bulletins are chained into bulletin-boards, in a doubly-linked list.

References: KERN BULLETIN_BOARD, ENTITY

by KERN BULLETIN_BOARD, ENTITY

Data: public BULLETIN *next_ptr;

list pointer


public BULLETIN *previous_ptr;

list pointer


public BULLETIN_BOARD* owner_ptr;

pointer to the owner of this bulletin


public BULLETIN *next_bb_b_ptr;

next pointer

Constructor: public: BULLETIN::BULLETIN (


ENTITY*, // old entity


ENTITY* // new entity


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments. Applications should call this constructor only with the overloaded new operator, because this reserves the memory on the heap, a requirement to support roll back and history management.


Creates a bulletin for the given old and new entities, and adds it to the current bulletin-board (which must already exist).






public: BULLETIN::BULLETIN ();


C++ constructor.




Destructor: public: BULLETIN::~BULLETIN ();


C++ destructor, deleting a BULLETIN.



Methods: public: logical


BULLETIN::attrib_only_change () const;


Returns whether or not there has been a change to only the attribute.






public: void BULLETIN::clear_history ();


Clear the history stream.






public: void BULLETIN::debug (


FILE* // file pointer



= debug_file_ptr


) const;


Outputs debug information about BULLETIN to standard output or to the specified file.






public: void BULLETIN::debug (


int id, // id


int level, // level


FILE* // file name



= debug_file_ptr


) const;


Writes information about the BULLETIN to the debug file or to the specified file.






public: ENTITY* BULLETIN::entity_ptr () const;


Returns a pointer to the current entity.






public: logical BULLETIN::fix_pointers (


ENTITY* elist[], // pointers to fix


BULLETIN_BOARD* owner // owner


);


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 BULLETIN::fix_pointers (


ENTITY_ARRAY& elist, // pointers to fix


BULLETIN_BOARD* owner // owner


);


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: HISTORY_STREAM* BULLETIN::history_stream (


logical from_ents
// from entities



= FALSE
// or not


) const;


Gets history from either bulletin board or entities






public: void BULLETIN::make_delete ();


Concatenates a change (or create) operation and a delete bulletin on the same ENTITY on the same bulletin board.






public: logical BULLETIN::mixed_streams (


HISTORY_STREAM*& ent_hs,
// entity history


logical& can_be_fixed,
// fixable or not


logical& stream_corrupt, // corrupt or not


HISTORY_STREAM* bb_hs
// bulletin board



= NULL
// history

) const;


Returns TRUE when the entity's history, ent_hs, does not match the bulletin board's history, bb_hs. The entity's history is returned. The bulletin board's history can either be supplied (for performance) or figured out.






public: ENTITY* BULLETIN::new_entity_ptr () const;


Returns a pointer to the new entity created after an operation on the model.






public: BULLETIN* BULLETIN::next () const;


Returns the pointer to the next bulletin on the bulletin board.






public: BULLETIN* BULLETIN::next_bb_b () const;


Bulletin for an entity on the next bulletin board.






public: logical BULLETIN::no_change () const;


Returns whether or not there has been a change.






public: void BULLETIN::null_new_entity_ptr ();


Null the old entity pointer.






public: void BULLETIN::null_old_entity_ptr ();


Null the new entity pointer.






public: ENTITY* BULLETIN::old_entity_ptr () const;


Returns the pointer to the old entity.






public: BULLETIN_BOARD* BULLETIN::owner () const;


Returns the owner of the entity corresponding to the bulletin.






public: BULLETIN* BULLETIN::previous () const;


Returns the pointer to the previous bulletin on the bulletin board.






public: logical BULLETIN::restore (


BULLETIN* previous_b, // previous bull. board


logical ignore_string_version // ingore version



= FALSE
// or not


);


Modifies the bulletin such that the new and old ENTITY pointers reflect the change of state.


#if SAVE_NAMES

read_id Read in the identification for the bulletin

#endif

read_pointer Pointer to a record in the SAT file for the old ENTITY.

read_pointer


Pointer to a record in the SAT file for the new ENTITY.






public: void BULLETIN::roll ();


Modifies the bulletin such that the new and old ENTITY pointers reflect the change of state.






public: logical BULLETIN::save (


ENTITY_LIST& elist // entity list


logical ignore_string_version // ingore version



= FALSE
// or not


);


Saves the entities corresponding to the bulletin.






public: void BULLETIN::set_entity_ptrs (


ENTITY* old_ent,
// old entity


ENTITY* new_ent
// new entity


);


Set the entity pointers.






public: void BULLETIN::set_history (


HISTORY_STREAM* hist
// history stream


) const;


Set the current history stream.






public: void BULLETIN::set_next_bb_b (


BULLETIN*
// bulletin


);


Set the corresponding bulletin in the next bulletin board.






public: int BULLETIN::size (


logical include_backups // include backups



= TRUE // as part of size


) const;


Returns the size of the BULLETIN.






public: void BULLETIN::swap (


ENTITY* this_ent, // this entity


ENTITY* that_ent // that entity


);


Swap one entity for another.






public: BULLETIN_TYPE BULLETIN::type () const;


Returns the type of BULLETIN. Four types of bulletins are defined: NO_BULLETIN, CREATE_BULLETIN, CHANGE_BULLETIN, and DELETE_BULLETIN.




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
PDF/KERN/28CLB.PDF
HTM/DATA/KERN/KERN/28CLB/0007.HTM