Previous | Contents | Index |
rtr_status_t Increment();
rtr_status_t Interpret value for the success or failure of this call.
The more specific counter class error status descriptions for RTR_STSCTRBADREF and RTR_STS_INVOBJFAILCNSTR are:
None
Call this method to increment a numeric counter. This method can be called only after setting value.
rtr_const_countername_t kCounter = "test-counter-signed-increment"; rtr_const_countergroupname_t kGroup = "test-counter-group"; RTRSignedCounter c(kCounter, kGroup); rtr_sgn_32_t v = 0; const rtr_sgn_32_t kValue = 668; bool bOverallResult = true; rtr_status_t stsSetValue; stsSetValue = c.SetValue(kValue); if (IsFailure(stsSetValue == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsSetValue); } rtr_status_t stsIncrement; stsIncrement = c.Increment(); if (IsFailure(stsIncrement == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsIncrement); }
rtr_status_t SetValue( rtr_sgn_32_t CounterVal );
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_INVOBJFAILCNSTR | Invalid object due to failure during object construction. |
The more specific counter class error status description for RTR_STS_INVOBJFAILCNSTR is:
The object is invalid because the values passed in the constructor were invalid.
CounterVal
A counter value for a specified RTR counter.
Call this method to set value for a counter. Object should be declared before setting value.
rtr_status_t sStatus; int iSetValue = 100; sStatus = IIntCounter->SetValue(iSetValue);
RTRSignedCounter( rtr_const_countername_t pszCounterName , rtr_const_countergroupname_t pszCounterGroupName);
None
pszCounterName
A null-terminated string pointer to the name of an RTR counter.pszCounterGroupName
A null-terminated string pointer to the name of an RTR counter group.
This method used to declare an RTRSignedCounter object. The constructor creates an instance of the RTRSignedCounter class. The application must call SetValue() to initialize the counter.All counters are process-specific. All counter names must be unique within the entire process without regard to the group name. For example, it is invalid to have an RTRSignedCounter name "MyCounter" and another RTRStringCounter name "MyCounter."
rtr_counter_data_type eCtrtype = rtr_counter_int; RTRSignedCounter *iIntCounter = new RTRSignedCounter("MyCounter3","GroupName",eCtrtype);
4.11 RTRStringCounter
To use a counter, perform the following steps:
Construction
Method | Description |
---|---|
RTRStringCounter( const char, const char, rtr_counter_data_type) | Constructor |
~RTRStringCounter() | Destructor |
Operations
Method | Description |
---|---|
GetValue(char) | Retrieve the value managed by the counter class. |
SetValue(const char) | Set the value managed by the counter class. |
rtr_status_t GetValue(char * pszCounterVal);
rtr_status_t Interpret value for the success or failure of this call.
The more specific counter class error status descriptions for RTR_STSCTRBADREF and RTR_STS_INVOBJFAILCNSTR are:
pszCounterVal
A null-terminated string pointer to the name of an RTR counter.
Call this method to get a counter value. GetValue can be called only after setting a value (SetValue).
int IIntCounter; rtr_status_t sStatus; sStatus = cMyCounter.GetValue(IIntCounter); if (sStatus!= RTR_STS_OK) cerr<<"Error while getting counter value";
rtr_status_t SetValue(const char * pszCounterVal);
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_INVOBJFAILCNSTR | Invalid object due to failure during object construction. |
The more specific counter class error status description for RTR_STS_INVOBJFAILCNSTR is:
The object is invalid because the values passed in the constructor were invalid.
pszCounterVal
A null-terminated string pointer to the value of an RTR counter.
Call this method to set a counter value.
rtr_status_t sStatus; int iSetValue = 100; sStatus = IIntCounter->SetValue(iSetValue);
RTRStringCounter(const char *pszCounterName , const char *pszCounterGroupName);
None
pszCounterName
A null-terminated string pointer to the name of an RTR counter.pszCounterGroupName
A null-terminated string pointer to the name of an RTR counter group.
This method used to declare an RTRStringCounter object. The constructor creates an instance of the RTRStringCounter class. The application must call SetValue() to initialize the counter.All counters are process-specific. All counter names must be unique within the entire process without regard to the group name. For example, it is invalid to have an RTRStringCounter name "MyCounter" and another RTRSignedCounter name "MyCounter."
rtr_counter_data_type eCtrtype = rtr_counter_int; RTRStringCounter *iIntCounter = new RTRStringCounter("MyCounter2","GroupName",eCtrtype);
4.12 RTRUnsignedCounter
To use a counter, perform the following steps:
Construction
Method | Description |
---|---|
RTRUnsignedCounter( rtr_const_countername_t, rtr_const_countergroupname_t) | Constructor |
~RTRUnsignedCounter() | Destructor |
|
Operations
Method | Description |
---|---|
Decrement() | Decrement the value managed by the counter class. |
GetValue(rtr_uns_32_t) | Retrieve the value managed by the counter class. |
Increment() | Increment the value managed by the counter class. |
SetValue(rtr_uns_32_t) | Set the value managed by the counter class. |
rtr_status_t Decrement();
rtr_status_t Interpret value for the success or failure of this call.
The more specific counter class error status descriptions for RTR_STSCTRBADREF and RTR_STS_INVOBJFAILCNSTR are:
None
Call this method to decrement a numeric counter. Decrement method can be called only after setting value.
RTRUnsignedCounter c(kCounter, kGroup); rtr_uns_32_t v = 0; const rtr_uns_32_t kValue = 669; bool bOverallResult = true; rtr_status_t stsSetValue; stsSetValue = c.SetValue(kValue); if (IsFailure(stsSetValue == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsSetValue); } rtr_status_t stsDecrement; stsDecrement = c.Decrement(); if (IsFailure(stsDecrement == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsDecrement); }
rtr_status_t GetValue(rtr_uns_32_t &CounterVal);
rtr_status_t Interpret value for the success or failure of this call.
The more specific counter class error status descriptions for RTR_STSCTRBADREF and RTR_STS_INVOBJFAILCNSTR are:
CounterVal
A counter value for a specified RTR counter.
Call this method to get a counter value. GetValue can be called only after setting value (SetValue).
rtr_status_t sStatus; sStatus = IIntCounter->GetValue(iReturnValue);
rtr_status_t Increment();
rtr_status_t Interpret value for the success or failure of this call.
The more specific counter class error status descriptions for RTR_STSCTRBADREF and RTR_STS_INVOBJFAILCNSTR are:
RTR_STSCTRBADREF
The object has not been initialized by the application. All counters must be given a default value by calling SetValue() after object construction.
RTR_STS_INVOBJFAILCNSTR
The object is invalid because the values passed in the constructor were invalid.
None
Call this method to increment a numeric counter. This method can be called only after setting value.
rtr_status_t stsIncrement; stsIncrement = c.Increment(); if (IsFailure(stsIncrement == RTR_STS_OK)) { bOverallResult = false; OutputStatus(stsIncrement); }
rtr_status_t SetValue( rtr_uns_32_t CounterVal );
rtr_status_t Interpret value for the success or failure of this call.
Status | Message |
---|---|
RTR_STS_OK | Normal successful completion |
RTR_STS_INVOBJFAILCNSTR | Invalid object due to failure during object construction. |
The more specific counter class error status description for RTR_STS_INVOBJFAILCNSTR is:
The object is invalid because the values passed in the constructor were invalid.
CounterVal
A counter value for a specified RTR counter.
Call this method to set value for a counter. Object should be declared before setting value.
rtr_status_t sStatus; int iSetValue = 100; sStatus = IIntCounter->SetValue(iSetValue);
RTRUnsignedCounter( rtr_const_countername_t pszCounterName , rtr_const_countergroupname_t pszCounterGroupName);
None
pszCounterName
A null-terminated string pointer to the name of an RTR counter.pszCounterGroupName
A null-terminated string pointer to the name of an RTR counter group.
This method used to declare an RTRUnsignedCounter object. The constructor creates an instance of the RTRUnsignedCounter class. The application must call SetValue() to initialize the counter.All counters are process-specific. All counter names must be unique within the entire process without regard to the group name. For example, it is invalid to have an RTRUnsignedCounter name "MyCounter" and another RTRStringCounter name "MyCounter."
rtr_counter_data_type eCtrtype = rtr_counter_int; RTRUnsignedCounter *iIntCounter = new RTRUnsignedCounter("MyCounter1","GroupName",eCtrtype)
Previous | Next | Contents | Index |