![]() |
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. | |
Dob::CallbackId::Enumeration | GetCurrentCallbackId () const |
Get info about which callback you are currently executing in. | |
Connection info | |
const std::wstring | GetConnectionName () const |
Get the name for this connection used in the system. | |
const std::wstring | GetConnectionNameCommonPart () const |
Get the common part of the connection name. | |
const std::wstring | GetConnectionNameInstancePart () const |
Get the instance part of the connection name. | |
Dob::Typesystem::Int32 | GetContext () const |
Get the context that the connection is opened in. | |
Dob::Typesystem::Int64 | GetNodeId () const |
Get the Node Identifier of the current node. | |
bool | IsLightNode () const |
Check whether the current node is a light node. | |
Queue Status | |
Dob::Typesystem::Int32 | GetQueueCapacity (const Dob::ConnectionQueueId::Enumeration queue) const |
Get the capacity of the specified queue. | |
Dob::Typesystem::Int32 | GetQueueSize (const Dob::ConnectionQueueId::Enumeration queue) const |
Get the number of items currently in the queue. | |
Debug | |
void | SimulateOverflows (const bool inQueues, const bool outQueues) const |
Turn simulation of overflow on/off. | |
Shared Memory statistics | |
Typesystem::Int64 | GetSharedMemoryUsage () const |
Get the number of currently used bytes in the shared memory. | |
Dob::MemoryLevel::Enumeration | GetSharedMemoryLevel () const |
Get the usage level of the shared memory. | |
Additional Inherited Members | |
![]() | |
ConnectionAspectBase (const ConnectionBase &connection) | |
Constructor. | |
virtual | ~ConnectionAspectBase () |
Destructor. | |
long | GetControllerId () const |
Get the id of the controller. | |
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.
Dob::CallbackId::Enumeration Safir::Dob::ConnectionAspectMisc::GetCurrentCallbackId | ( | ) | const |
Get info about which callback you are currently executing in.
Dob::Typesystem::Int64 Safir::Dob::ConnectionAspectMisc::GetNodeId | ( | ) | const |
Get the Node Identifier of the current node.
Be aware that this identifier changes every time the node restarts.
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. |
Dob::MemoryLevel::Enumeration Safir::Dob::ConnectionAspectMisc::GetSharedMemoryLevel | ( | ) | const |
Get the usage level of the shared memory.
When the memory level gets to Low or below that there will be operations that are no longer allowed. See the User's Guide for more information.
Calling this function does not require the underlying Connection to have been opened.
Typesystem::Int64 Safir::Dob::ConnectionAspectMisc::GetSharedMemoryUsage | ( | ) | const |
Get the number of currently used bytes in the shared memory.
The size of the shared memory is defined by the parameter Safir.Dob.NodeParameters.SharedMemorySize, which is defined in megabytes (1024*1024 bytes).
Calling this function does not require the underlying Connection to have been opened.
bool Safir::Dob::ConnectionAspectMisc::IsLightNode | ( | ) | const |
Check whether the current node is a light node.
This is slightly easier than looking through the parameters to work this out.
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. |