#include <tscache.h>
Public Methods | |
TipcSrvCache (const char *smartCache, const TipcSrv &tsrv) throw (TipcException) | |
~TipcSrvCache () throw () | |
Destructor. | |
void | init () throw (TipcException) |
void | initLV (const char *cmd_file) throw (TipcException) |
void | gmdInit () throw (TipcException) |
void | gmdFinish () throw (TipcException) |
void | gmdFlush (const char *reqSubj, const char *reqSender) throw (TipcException) |
void | requestMsgs (const char *reqSubj, int4 numMsgs, real8 deltaTime) throw (TipcException) |
void | requestStart (const char *reqSubj, int4 numMsgs, real8 deltaTime) throw (TipcException) |
void | requestStop (const char *reqSubj) throw (TipcException) |
void | requestLastValue (const char *subject, const TipcMt &returnMt) throw (TipcException) |
void | sendRequest (const char *reqSubj, int4 numMsgs, real8 deltaTime) throw (TipcException) |
void | sendRequestLastValue (const char *reqSubj, real8 deltaTime) throw (TipcException) |
|
Constructor param smartCache - subject of SmartCache group param tsrv - TipcSrv object required for the SmartCache throw TipcSrvCacheException if the TipcSrvCache is not created |
|
Performs required clean up procedure when SmartCache stops to cache GMD message for this RTclient. It sends a message to smartCache to stop the GMD message caching. throw TipcSrvCacheException if the clean up procedure fails. |
|
This function is used to flush the SmartCache for cached messages from senders. This function sends a message to SmartCache to delete cached messages for the specified subject from the specified RTclient (identified by its unique subject). The value reqSubj or reqSender (but not both) can be set to T_CACHE_FLUSH_ALL to flush all the subjects or senders param reqSubj - Subject to be flushed
|
|
Performs initializations required to use SmartCache to cache GMD message from this RTclient. It sends a message to the group smartCache to start the GMD message caching for this publisher. NOTE: Use gmdInit() only on the publisher, whose GMD message is cached by SmartCache.
|
|
Performs initializations required to use SmartCache. This function must be called prior to any other SmartCache API call and prior to parsing a configuration/command file.
|
|
Performs initializations required to use SmartCache with last value caching. This function must be used instead of init if the client will be asking for last values from the cache. It must be called prior to any other SmartCache API call and prior to parsing a configuration/command file.
|
|
Sends a request to SmartCache to return the last message of each message type published to that subject. SmartCache will return a T_MT_CACHE_LV_RESPONSE message type. This message will contain the last message of each of the message type being cached in the cache in time-sequenced order. The client library will parse the reply message from cache to build the returnMt by extracting the last field from each of the messages. If T_NULL is specified for returnMt, or if the client library does not have a definition of any of the message types involved, each of the messages in the reply message from the cache will be processed in time-sequenced order using TipcSrvMsgProcess. If T_NULL is specified for smartCache the client library will make a request to each of the SmartCache groups listed in the option CACHE_GROUP_NAMES. Only the cache group containing the required subject will reply. If multiple cache groups send replies to the request, only the first one will be accepted.
|
|
This function is used to request messages from SmartCache. This function sends an RPC message to the SmartCache group identified by smartCache requesting the last numMsgs messages (or all the messages available if set to T_CACHE_ALL) no older than deltaTime seconds (or all the messages regardless of their age if set to T_CACHE_ALL) cached for the subject reqSubj. If reqSubj is a wildcard, SmartCache will return messages for all cached subjects matching the wildcard. SmartCache replies with a message containing all of the messages matching the two criteria. The function then calls TipcSrvMsgProcess() for each one of these messages. If T_NULL is specified for smartCache the client library will make a request to each of the SmartCache groups listed in the option CACHE_GROUP_NAMES. Only the cache group containing the required subject will reply. If multiple cache groups send replies to the request, only the first one will be accepted.
|
|
Sends a request to SmartCache to begin caching messages for a particular subject.
|
|
Sends a request to SmartCache to stop caching messages for a particular subject.
|
|
This function is used to format and send a request message to SmartCache. Unlike the requestMsgs method, it does not wait for the response. The bundled response is expected to be handled by the caller. Therefore, a callback must be in place for the return message type T_MT_CACHE_RESPONSE. If T_NULL is specified for smartCache the client library will make a request to each of the SmartCache groups listed in the option CACHE_GROUP_NAMES. Only the cache group containing the required subject will reply. If multiple cache groups send replies to the request, only the first one will be accepted.
|
|
This function is used to format and send a request message to SmartCache. Unlike the requestMsgs method, it does not wait for the response. The bundled response is expected to be handled by the caller. Therefore, a callback must be in place for the return message type T_MT_CACHE_LV_RESPONSE. This function is to get the last value from the cache. If T_NULL is specified for smartCache the client library will make a request to each of the SmartCache groups listed in the option CACHE_GROUP_NAMES. Only the cache group containing the required subject will reply. If multiple cache groups send replies to the request, only the first one will be accepted.
|