Implements creators for most interface classes.
#include "util/utilfactory.h"
◆ CreateListen() [1/2]
std::unique_ptr< log::IListen > util::UtilFactory::CreateListen |
( |
const std::string & | type, |
|
|
const std::string & | share_name ) |
|
static |
Creates a listen object. It only exist 3 basic objects to create.
The 'ListenProxy' object sends messages through a shared memory to a common server object. This type of listen object is normal when several executable should share a listen 'channel'. Typically is when debugging database calls.
The 'ListenServer' shall be used when the application want its own listen 'channel'. This is typically used for protocol drivers.
The 'ListenConsole' logs the message onto a console window (std::cout). It shall be used when putting messages from a proxy onto a console window. This object is mainly used for testing.
- Parameters
-
type | Select between 'ListenProxy','ListenServer' or 'ListenConsole' |
share_name | Unique share name or empty string. |
- Returns
- A smart pointer to a listen object.
◆ CreateListen() [2/2]
Creates a listen (server) object. A listen object is an abstract object that is used to debug inside application. This enables simple debugging in delivered system. The user simply generates debug text lines that the Listen object forward to a Listen Window. The Listen Window (listenviewer.exe) GUI present the debug text lines. The trick is that when no Listen Window is open, the Listen object goes into idle mode not disturbing or delaying the application software. It exist 3 basic objects to create.
The ListenProxyType object sends messages through a shared memory to a common server object. This type of listen object is normal when several executable should share a listen 'channel'. Typical application is when debugging database calls.
The 'ListenServer' shall be used when the application want its own listen 'channel'. Typical application is when protocol drivers.
The 'ListenConsole' logs the message onto a console window (std::cout). It shall be used when putting messages from a proxy onto a console window. This object is mainly used for testing.
- Parameters
-
type | Select between ListenProxyType,ListenServerType' or ListenConsoleType |
share_name | Unique share name or empty string. |
- Returns
- A smart pointer to a listen object.
◆ CreateListenClient()
std::unique_ptr< log::IListenClient > util::UtilFactory::CreateListenClient |
( |
const std::string & | host, |
|
|
uint16_t | port ) |
|
static |
Creates a TCP/IP listen client object.
- Parameters
-
host | Host name |
port | TCP/IP port to connect to. |
- Returns
- Smart pointer to a IListenClient.
◆ CreateLogger()
std::unique_ptr< log::ILogger > util::UtilFactory::CreateLogger |
( |
log::LogType | type, |
|
|
const std::vector< std::string > & | arg_list ) |
|
static |
Creates a pre-defined log source. Choose between console, file, listen or syslog sources. The file source requires a base name (no path or extension) as input argument. The syslog require 2 arguments, remote host name and port.
- Parameters
-
type | Type of log source. |
arg_list | Extra arguments |
- Returns
- Smart pointer to a log source.
◆ CreateSuperviseMaster()
Creates a supervise
- Parameters
-
- Returns
◆ CreateSyslogServer()
Creates a syslog server. Choose between UDP, TLS or TCP servers.
- Parameters
-
type | Type of syslog protocol- |
- Returns
- Smart pointer to a syslog server.
The documentation for this class was generated from the following file: