Safir SDK Core
|
Class that provides miscellaneous methods that are used less frequently. More...
#include <Safir/Dob/ConnectionAspectMisc.h>
Public Member Functions | |
ConnectionAspectMisc (const ConnectionBase &connection) | |
Constructor. More... | |
const Dob::CallbackId::Enumeration | GetCurrentCallbackId () const |
Get info about which callback you are currently executing in. More... | |
Connection info | |
const std::wstring | GetConnectionName () const |
Get the name for this connection used in the system. More... | |
const std::wstring | GetConnectionNameCommonPart () const |
Get the common part of the connection name. More... | |
const std::wstring | GetConnectionNameInstancePart () const |
Get the instance part of the connection name. More... | |
Dob::Typesystem::Int32 | GetContext () const |
Get the context that the connection is opened in. More... | |
Queue Status | |
Dob::Typesystem::Int32 | GetQueueCapacity (const Dob::ConnectionQueueId::Enumeration queue) const |
Get the capacity of the specified queue. More... | |
Dob::Typesystem::Int32 | GetQueueSize (const Dob::ConnectionQueueId::Enumeration queue) const |
Get the number of items currently in the queue. More... | |
Debug | |
void | SimulateOverflows (const bool inQueues, const bool outQueues) const |
Turn simulation of overflow on/off. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Safir::Dob::ConnectionAspectBase | |
ConnectionAspectBase (const ConnectionBase &connection) | |
Constructor. More... | |
virtual | ~ConnectionAspectBase () |
Destructor. More... | |
long | GetControllerId () const |
Get the id of the controller. More... | |
Class that provides miscellaneous methods that are used less frequently.
|
explicit |
Constructor.
connection | The connection that you want to operate through. |
const std::wstring Safir::Dob::ConnectionAspectMisc::GetConnectionName | ( | ) | const |
Get the name for this connection used in the system.
The connection name is composed of the name parts given by the application when opening the connection, with some additional decoration made by the DOB.
const std::wstring Safir::Dob::ConnectionAspectMisc::GetConnectionNameCommonPart | ( | ) | const |
Get the common part of the connection name.
const std::wstring Safir::Dob::ConnectionAspectMisc::GetConnectionNameInstancePart | ( | ) | const |
Get the instance part of the connection name.
Dob::Typesystem::Int32 Safir::Dob::ConnectionAspectMisc::GetContext | ( | ) | const |
Get the context that the connection is opened in.
const Dob::CallbackId::Enumeration Safir::Dob::ConnectionAspectMisc::GetCurrentCallbackId | ( | ) | const |
Get info about which callback you are currently executing in.
Dob::Typesystem::Int32 Safir::Dob::ConnectionAspectMisc::GetQueueCapacity | ( | const Dob::ConnectionQueueId::Enumeration | queue | ) | const |
Get the capacity of the specified queue.
This method returns the maximum number of items that the queue can hold.
queue | [in] The queue to get info for. |
Dob::Typesystem::Int32 Safir::Dob::ConnectionAspectMisc::GetQueueSize | ( | const Dob::ConnectionQueueId::Enumeration | queue | ) | const |
Get the number of items currently in the queue.
This method returns the number of items that is currently in the specified queue. NOTE: This method is only implemented for out-queues (MessageOutQueue, RequestOutQueue) If this method is called for an in-queue, a SoftwareViolationException will be thrown.
queue | [in] The queue to get info for. |
void Safir::Dob::ConnectionAspectMisc::SimulateOverflows | ( | const bool | inQueues, |
const bool | outQueues | ||
) | const |
Turn simulation of overflow on/off.
For test purposes.
Setting inQueues to true means that no messages or requests are handled by the application. An incoming request will result in an overflow, and an incoming message will be discarded. Setting outQueues to true means that no messages or requests can be sent from the application, instead these calls will throw a Safir::Dob::OverflowException. When reset to false OnXxxxNotOverflow will be called as expected. Use this to verify that your application handles overflows correctly.
Note that the inQueues flag is not applied to new consumers added after this call.
[in] | inQueues | If true all incoming queues are simulated full. |
[in] | outQueues | If true all outgoing queues are simulated full. |