Content-type: text/html
RTRegister *RTRegister_Constructor(const char *name, size_t size, RTRegister_Data *value, RTRefCnt_Destructor destructor);
RTRegister *RTRegister_Lookup(const char *name);
int RTRegister_Write(RTRegister *regp, RTRegister_Data *value);
const char *RTRegister_Name(RTRegister *regp);
size_t RTRegister_Size(RTRegister *regp);
RTObserver*RTRegister_Observe(RTRegister* regp ,RTReactiveTask* rtp);
int RTRegister_Unobserve(RTRegister *regp, RTObserver *obp);
int RTRegister_Read(RTRegister *regp, RTRegister_Data *value);
void RTRegister_Update_Release(RTRegister_Update *upp);
void RTRegister_Release(RTRegister *regp);
RTRegister_Constructor creates a named register of size bytes with an initial value given by value. Since the object is opaque, an optional destructor can be used to free a complex structure. Upon successful construction, the returned RTRegister reference can be used for the other calls of the class. The RTRegister is an RTRefCnt_Object.
RTRegister_Lookup takes the name of a register and returns an RTRegister reference which may be used for other calls of the class. This allows "others" to use a name abstraction so that each client will own its own reference. The name space is unconstrained by the Chronolytix system and the names are hashed for O(1) lookup.
RTRegister_Write will copy the data into the given register. If the data is not binary identical (memcmp), and if any observers are present, the observers events are invoked. It is generally recommended that the observer resample the register using RTRead rather than relying on the possibly stale reference passed through the RTReactiveTask argument. It is recommended that the observer callback refrain from doing an RTRegister_Write in its own register as this self-exciting behavior will degrade system performance.
RTRegister_Observe is used for a client to observe for changes in the register. The RTReactiveTask argument bundles the callback for the observer. The second argument to the observers RTEvent is the RTRegister_Update reference counted object.
RTRegister_Unobserve removes an observer from the RTRegister. The observer should take care to coordinate the unobserve with pending reactive update callbacks so that a callback after free is avoided.
RTRegister_Update_Release releases the reference counted RTRegister_Update callback. Most of the time, this should be automatic for the RTEvent callback.
RTRegister_Release is the way for a client to give up its reference to an RTRegister. The is applicable whether the reference is obtained by name or by construction. Upon the release of the last reference, the register is destroyed by calling the destructor supplied at construction.
RTRegister_Name and RTRegister_Size are helper functions that allow clients to gain information from an otherwise opaque RTRegister reference.
RTRegister is a Chronolytix Layer 1 function.
RTObserver "Lstn"