AGXDynamics  2.31.1.0
agxNet::Library Class Referenceabstract

Library singleton class. More...

#include <Socket.h>

+ Inheritance diagram for agxNet::Library:

Public Types

enum  Priority { HIGHEST_PRIORITY = 2147483647, LOWEST_PRIORITY = 10000, DEFAULT_PRIORITY = 1073741824 }
 Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More...
 

Public Member Functions

 Library ()
 
virtual std::string getClassName () const =0
 
IPAddress getHostByName (const char *hostName, agx::UInt16 port)
 Resolve host IP by its name. More...
 
int getPriority () const
 Return the shutdown priority of the singleton instance. More...
 
virtual void shutdown () override
 instance the object, after this, the object cannot be used anymore. More...
 

Static Public Member Functions

static Library * instance ()
 Get the singleton instance. More...
 

Protected Member Functions

void _shutdown ()
 

Detailed Description

Library singleton class.

This is a library singleton class. Creating an object of this class initializes the library while destroying this object de initializes it. So, the convenient way of initializing the library is to create an object of this class on the stack. Thus, when the object goes out of scope its destructor will be called and the library will be de initialized automatically. This is what C++ RAII is all about ;-).

Definition at line 191 of file Socket.h.

Member Enumeration Documentation

◆ Priority

enum agx::Singleton::Priority
inherited

Specifies the ranges of the priority which can be assigned to a singleton at the time of creation.

Enumerator
HIGHEST_PRIORITY 

The highest priority that can be given to a singleton.

LOWEST_PRIORITY 

The lowest priority that can be given to a singleton.

DEFAULT_PRIORITY 

The default priority given to a singleton.

Definition at line 35 of file Singleton.h.

Constructor & Destructor Documentation

◆ Library()

agxNet::Library::Library ( )

Member Function Documentation

◆ _shutdown()

void agx::Singleton::_shutdown ( )
protectedinherited

◆ getClassName()

virtual std::string agx::Singleton::getClassName ( ) const
pure virtualinherited

◆ getHostByName()

IPAddress agxNet::Library::getHostByName ( const char *  hostName,
agx::UInt16  port 
)

Resolve host IP by its name.

This function resolves host IP address by its name. If it fails resolving the IP address it will Throw NetError.

Parameters
hostName- null-terminated string representing host name. Example: "www.somedomain.com".
port- IP port number which will be placed in the resulting IPAddress structure.
Returns
filled IPAddress structure.

◆ getPriority()

int agx::Singleton::getPriority ( ) const
inherited

Return the shutdown priority of the singleton instance.

◆ instance()

static Library* agxNet::Library::instance ( )
static

Get the singleton instance.

◆ shutdown()

virtual void agxNet::Library::shutdown ( )
overridevirtual

instance the object, after this, the object cannot be used anymore.

Called by singleton manager.

Reimplemented from agx::Singleton.


The documentation for this class was generated from the following file: