Ocean
Ocean::CommandArguments::Manager Class Reference

This class implements a simple singleton holding the raw application's command arguments. More...

Inheritance diagram for Ocean::CommandArguments::Manager:

Public Member Functions

bool setRawArguments (const char *const *arguments, const size_t size)
 Sets/registers the command arguments of the application. More...
 
bool setRawArguments (const wchar_t *const *arguments, const size_t size)
 Sets/registers the command arguments of the application. More...
 
template<typename TChar = char>
const TChar *const * rawArguments () const
 Returns the command arguments of the application. More...
 
size_t size () const
 Returns the number of command arguments of the application. More...
 

Protected Member Functions

 Manager ()
 Protected default constructor. More...
 
- Protected Member Functions inherited from Ocean::Singleton< Manager >
 Singleton ()=default
 Default constructor. More...
 

Protected Attributes

const char *const * argumentsChar_ = nullptr
 The command arguments, nullptr if no arguments are defined. More...
 
const wchar_t *const * argumentsWchar_ = nullptr
 The command arguments, nullptr if no arguments are defined. More...
 
size_t size_ = 0
 The number of command arguments, with range [0, infinity). More...
 
Lock lock_
 The manager's lock. More...
 

Friends

class Singleton< Manager >
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< Manager >
static Manager & get ()
 Returns a reference to the unique object. More...
 

Detailed Description

This class implements a simple singleton holding the raw application's command arguments.

Constructor & Destructor Documentation

◆ Manager()

Ocean::CommandArguments::Manager::Manager ( )
protected

Protected default constructor.

Member Function Documentation

◆ rawArguments()

template<typename TChar = char>
const TChar* const* Ocean::CommandArguments::Manager::rawArguments ( ) const

Returns the command arguments of the application.

Returns
The application's command arguments, nullptr if the arguments have not been set via setArguments().
Template Parameters
TCharThe character type, char or wchar_t
See also
setArguments().

◆ setRawArguments() [1/2]

bool Ocean::CommandArguments::Manager::setRawArguments ( const char *const *  arguments,
const size_t  size 
)

Sets/registers the command arguments of the application.

Parameters
argumentsThe arguments to set, ensure that the pointer is valid as long as the application exists, must be valid
sizeThe number of provided command arguments, with range [1, infinity)

◆ setRawArguments() [2/2]

bool Ocean::CommandArguments::Manager::setRawArguments ( const wchar_t *const *  arguments,
const size_t  size 
)

Sets/registers the command arguments of the application.

Parameters
argumentsThe arguments to set, ensure that the pointer is valid as long as the application exists, must be valid
sizeThe number of provided command arguments, with range [1, infinity)

◆ size()

size_t Ocean::CommandArguments::Manager::size ( ) const

Returns the number of command arguments of the application.

Returns
The application's number of command arguments, 0 if arguments have not been set via setArguments().
See also
setArguments().

Friends And Related Function Documentation

◆ Singleton< Manager >

friend class Singleton< Manager >
friend

Field Documentation

◆ argumentsChar_

const char* const* Ocean::CommandArguments::Manager::argumentsChar_ = nullptr
protected

The command arguments, nullptr if no arguments are defined.

◆ argumentsWchar_

const wchar_t* const* Ocean::CommandArguments::Manager::argumentsWchar_ = nullptr
protected

The command arguments, nullptr if no arguments are defined.

◆ lock_

Lock Ocean::CommandArguments::Manager::lock_
mutableprotected

The manager's lock.

◆ size_

size_t Ocean::CommandArguments::Manager::size_ = 0
protected

The number of command arguments, with range [0, infinity).


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