AGX Dynamics  2.37.2.0
agxNet::Library Class Reference

Library singleton class. More...

#include <Socket.h>

+ Inheritance diagram for agxNet::Library:

Public Member Functions

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

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from agx::Singleton
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...
 
- Protected Member Functions inherited from agx::Singleton
virtual ~Singleton ()
 Destructor. More...
 
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 200 of file Socket.h.

Constructor & Destructor Documentation

◆ Library()

agxNet::Library::Library ( )

Member Function Documentation

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

◆ 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: