Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::Dob::ConnectionAspectMisc Class Reference

Class that provides miscellaneous methods that are used less frequently. More...

#include <Safir/Dob/ConnectionAspectMisc.h>

Inheritance diagram for Safir::Dob::ConnectionAspectMisc:
Collaboration diagram for Safir::Dob::ConnectionAspectMisc:

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...
 

Detailed Description

Class that provides miscellaneous methods that are used less frequently.

Constructor & Destructor Documentation

Safir::Dob::ConnectionAspectMisc::ConnectionAspectMisc ( const ConnectionBase connection)
explicit

Constructor.

Parameters
connectionThe connection that you want to operate through.

Member Function Documentation

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.

Returns
The connection name.
const std::wstring Safir::Dob::ConnectionAspectMisc::GetConnectionNameCommonPart ( ) const

Get the common part of the connection name.

Returns
The connection name common part specified when opening the connection.
const std::wstring Safir::Dob::ConnectionAspectMisc::GetConnectionNameInstancePart ( ) const

Get the instance part of the connection name.

Returns
The connection name instance part specified when opening the connection.
Dob::Typesystem::Int32 Safir::Dob::ConnectionAspectMisc::GetContext ( ) const

Get the context that the connection is opened in.

Returns
Context
const Dob::CallbackId::Enumeration Safir::Dob::ConnectionAspectMisc::GetCurrentCallbackId ( ) const

Get info about which callback you are currently executing in.

Returns
Id of the callback you are currently inside, or None if not in a callback.
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.

Parameters
queue[in] The queue to get info for.
Returns
The capacity of the queue.
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.

Parameters
queue[in] The queue to get info for.
Returns
The current size of the queue.
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.

Parameters
[in]inQueuesIf true all incoming queues are simulated full.
[in]outQueuesIf true all outgoing queues are simulated full.