VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm Namespace Reference

All VSM SDK functionality resides in this namespace. More...

Namespaces

 

Classes

class  Action
 Generic action. More...
 
class  Android_serial_processor
 Working with serial ports on Android platform. More...
 
class  Bo_value
 Helper class for byte-order-dependent value representation. More...
 
class  Callback
 Generic callback. More...
 
class  Callback_base
 Callback which can be executed. More...
 
class  Callback_forced_args
 Helper class for defining custom callback creation functions which force several first arguments for the user callback. More...
 
class  Callback_proxy
 Helper class for proxying callback invocation. More...
 
class  Camera_control_action
 Camera control action. More...
 
class  Camera_series_by_distance_action
 Performs a series of consequent camera shots in a fixed time intervals. More...
 
class  Camera_series_by_time_action
 Performs a series of consequent camera shots in a fixed time intervals. More...
 
class  Camera_trigger_action
 Camera trigger action. More...
 
class  Cartesian_tuple
 Coordinates tuple for cartesian CS. More...
 
class  Change_speed_action
 Immediate change or vehicle airspeed. More...
 
class  Crc32
 
class  Cucs_processor
 Handles interactions with CUCS. More...
 
struct  Debug_assert_exception_dummy_struct
 Exception to throw when debugging assertion fires. More...
 
class  Derived_exception
 Helper class for defining derived exceptions. More...
 
class  Device
 
class  Enum_set
 Convenient set of enum values. More...
 
class  Exception
 Base class for all VSM exceptions. More...
 
class  File_processor
 Processor for working with filesystem I/O. More...
 
class  Geodetic_tuple
 Coordinates tuple for geodetic CS. More...
 
class  Heading_action
 Change the heading of a vehicle. More...
 
class  Http_parser
 This class implements limited HTTP parser according to RFC7230 Supports: More...
 
struct  Internal_error_exception_dummy_struct
 Some unexpected internal error occurred. More...
 
struct  Invalid_op_exception_dummy_struct
 Indicates that the operation is invalid in current state. More...
 
struct  Invalid_param_exception_dummy_struct
 Indicates that some invalid parameter was passed to SDK API call. More...
 
class  Io_buffer
 Generic I/O buffer. More...
 
class  Io_request
 Base request for I/O operations. More...
 
class  Io_stream
 Abstract I/O stream interface. More...
 
class  Java
 
class  Landing_action
 Land at the specified position. More...
 
class  Local_interface
 
class  Log
 Class for handling log output. More...
 
class  Mavlink_decoder
 Decodes Mavlink 1.0 messages from byte stream. More...
 
class  Mavlink_demuxer
 Mavlink message demultiplexer based on message, system and component identifiers. More...
 
class  Mavlink_encoder
 Encoder capable of creating byte buffers based on Mavlink payload and identifiers. More...
 
class  Mavlink_stream
 Convenience class for interpreting an I/O stream as a stream of Mavlink messages. More...
 
class  Move_action
 Move vehicle to the specific position (waypoint). More...
 
struct  Nullptr_exception_dummy_struct
 Indicates that some object is not longer exists while its service is invoked. More...
 
class  Operation_waiter
 Class for synchronizing with request execution. More...
 
class  Panorama_action
 Panorama action. More...
 
class  Param_exception
 Exception class with one parameter. More...
 
class  Payload_steering_action
 Steer the vehicle payload. More...
 
class  Peripheral_device
 Base interface for a peripheral device. More...
 
class  Piped_request_waiter
 Request waiter which uses a pipe to signal about request submissions. More...
 
class  Poi_action
 Point of interest (POI) for a vehicle. More...
 
class  Position
 Immutable position in a specified coordinates system. More...
 
class  Properties
 This class represents persistent set of properties which can be stored and loaded in/from any stream. More...
 
class  Property
 
class  Property_list
 
class  Quaternion
 
class  Read_request
 Basic I/O read request. More...
 
class  Reference_guard
 Reference guard objects keep references for managed objects. More...
 
class  Repeat_servo_action
 Set_servo action. More...
 
class  Request_container
 Generic container for queued requests. More...
 
class  Request_context
 Request execution context. More...
 
class  Request_temp_completion_context
 Temporal request completion context. More...
 
class  Request_worker
 Class for convenient worker thread instantiation for processing requests in a set request containers. More...
 
class  Serial_processor
 Serial ports I/O processor. More...
 
class  Service_discovery_processor
 
class  Set_home_action
 Set home position action. More...
 
class  Set_servo_action
 Set_servo action. More...
 
class  Shared_memory
 Platform independent implementation of system-wide named shared memory used for interprocess communications. More...
 
class  Shared_mutex_file
 Cross-platform named mutex. More...
 
class  Singleton
 Helper class for implementing singletons. More...
 
class  Socket_processor
 Socket processor. More...
 
struct  System_exception_dummy_struct
 Exception for system call failure. More...
 
class  Takeoff_action
 Take off from the specified position and reach specified altitude. More...
 
class  Task
 Action plan for a single vehicle. More...
 
class  Task_attributes_action
 Task attributes action. More...
 
class  Text_stream_filter
 Class for convenient filtering of a text stream using regular expressions. More...
 
class  Timer_processor
 Timer processor manages all timers in the VSM. More...
 
class  Ucs_request
 
class  Vehicle
 Base class for user-defined vehicles. More...
 
class  Vehicle_command
 Information about a command for a vehicle. More...
 
class  Vehicle_request
 Base class of a generic request for a vehicle. More...
 
class  Vehicle_request_spec
 Vehicle request with specific payload. More...
 
class  Vehicle_request_spec< void >
 Specialization of request without payload. More...
 
class  Vsm_command
 
class  Wait_action
 Wait action. More...
 
class  Wgs84_datum
 Datum for WGS84 geodetic system. More...
 
class  Windows_wstring
 Helper class for constructing Windows API compatible wchar strings from UTF-8 strings. More...
 
class  Write_request
 Baser I/O write request. More...
 

Typedefs

typedef Position< Wgs84_datumWgs84_position
 Position defined in WGS84 geodetic system. More...
 
typedef std::shared_ptr< ugcs::vsm::proto::Vsm_message > Proto_msg_ptr
 
template<typename T >
using Le_value = Bo_value< T, internal::Le_converter >
 Little-endian value wrapper. More...
 
template<typename T >
using Be_value = Bo_value< T, internal::Be_converter >
 Big-endian value wrapper. More...
 
typedef ugcs::vsm::Param_exception< Debug_assert_exception_dummy_struct,> Debug_assert_exception
 
typedef ugcs::vsm::Param_exception< Nullptr_exception_dummy_struct,> Nullptr_exception
 
typedef ugcs::vsm::Param_exception< Invalid_param_exception_dummy_struct,> Invalid_param_exception
 
typedef ugcs::vsm::Param_exception< Invalid_op_exception_dummy_struct,> Invalid_op_exception
 
typedef ugcs::vsm::Param_exception< Internal_error_exception_dummy_struct,> Internal_error_exception
 
typedef ugcs::vsm::Param_exception< System_exception_dummy_struct,> System_exception
 
typedef Request_container::Request_waiter Request_waiter
 Request waiter type for convenient usage. More...
 
typedef Request_container::Request Request
 Request type for convenient usage. More...
 
typedef Request_context< true > Request_processor
 Request processor is a request execution context where request are processed. More...
 
typedef Request_context< false > Request_completion_context
 Request completion context is a request execution context where notification about request completions are processed.
 
typedef Callback_proxy< int, int, char ** > Program_init
 Signature for program initialization routine. More...
 
typedef Vehicle_request_spec< TaskVehicle_task_request
 Vehicle request for ugcs::vsm::Task payload. More...
 
typedef Vehicle_request_spec< Vehicle_commandVehicle_command_request
 Vehicle request for ugcs::vsm::Vehicle_command payload. More...
 
typedef Le_value< int8_t > Le_int8
 Standard primitive types for little-endian byte order. More...
 
typedef Le_value< uint8_t > Le_uint8
 
typedef Le_value< int16_t > Le_int16
 
typedef Le_value< uint16_t > Le_uint16
 
typedef Le_value< int32_t > Le_int32
 
typedef Le_value< uint32_t > Le_uint32
 
typedef Le_value< float > Le_float
 
typedef Le_value< double > Le_double
 
typedef Be_value< int8_t > Be_int8
 Standard primitive types for big-endian byte order. More...
 
typedef Be_value< uint8_t > Be_uint8
 
typedef Be_value< int16_t > Be_int16
 
typedef Be_value< uint16_t > Be_uint16
 
typedef Be_value< int32_t > Be_int32
 
typedef Be_value< uint32_t > Be_uint32
 
typedef Be_value< float > Be_float
 
typedef Be_value< double > Be_double
 
typedef Socket_processor::Stream Socket_stream
 Convenience types aliases. More...
 
typedef Socket_processor::Socket_listener Socket_listener
 

Enumerations

enum  Io_result {
  Io_result::OK, Io_result::TIMED_OUT, Io_result::CANCELED, Io_result::BAD_ADDRESS,
  Io_result::CONNECTION_REFUSED, Io_result::CLOSED, Io_result::PERMISSION_DENIED, Io_result::END_OF_FILE,
  Io_result::LOCK_ERROR, Io_result::OTHER_FAILURE
}
 Result of I/O operation. More...
 
enum  Run_as_service_result { SERVICE_RESULT_OK = 0, SERVICE_RESULT_ERROR = 1, SERVICE_RESULT_NORMAL_INVOCATION = -1 }
 Result of Run_as_service function SERVICE_RESULT_OK = 0: Was invoked as service and is about to end. More...
 

Functions

JNIEXPORT void JNICALL Java_com_ugcs_vsm_Vsm_StreamReady (JNIEnv *env, jobject _this, jint streamId)
 
JNIEXPORT void JNICALL Java_com_ugcs_vsm_Vsm_StreamClosed (JNIEnv *env, jobject _this, jint streamId)
 
JNIEXPORT void JNICALL Java_com_ugcs_vsm_Vsm_StreamWriteComplete (JNIEnv *env, jobject _this, jint streamId, jboolean succeeded)
 
JNIEXPORT void JNICALL Java_com_ugcs_vsm_Vsm_StreamReadComplete (JNIEnv *env, jobject _this, jint streamId, jobject buf)
 
template<class Callable , typename... Args>
Callback< Callable, void, Args... >::Ptr Make_callback (Callable &&callable, Args &&...args)
 Create a callback. More...
 
template<class Result , typename... Args>
callback_internal::Dummy_callback_helper< Result, Args... >::Callback_type::Ptr Make_dummy_callback ()
 Create dummy callback. More...
 
template<class Callback_ptr , typename Result , typename... Args>
constexpr void Callback_check_type ()
 Check if the specified callback type corresponds to the partial prototype. More...
 
float Normalize_angle_0_2pi (float a)
 
float Normalize_angle_minuspi_pi (float a)
 
constexpr bool Is_system_le ()
 Check if the system is little-endian. More...
 
constexpr bool Is_system_be ()
 Check if the system is big-endian. More...
 
template<typename T >
constexpr T Convert_be_8 (T x)
 Stub for easier conversion functions generalization. More...
 
template<typename T >
constexpr T Convert_be_16 (T x)
 Convert 16 bits value byte order from BE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_be_32 (T x)
 Convert 32 bits value byte order from BE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_be_64 (T x)
 Convert 64 bits value byte order from BE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_le_8 (T x)
 Stub for easier conversion functions generalization. More...
 
template<typename T >
constexpr T Convert_le_16 (T x)
 Convert 16 bits value byte order from LE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_le_32 (T x)
 Convert 32 bits value byte order from LE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_le_64 (T x)
 Convert 64 bits value byte order from LE to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_nh_8 (T x)
 Stub for easier conversion functions generalization. More...
 
template<typename T >
constexpr T Convert_nh_16 (T x)
 Convert 16 bits value byte order from network to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_nh_32 (T x)
 Convert 32 bits value byte order from network to host byte order and vice versa. More...
 
template<typename T >
constexpr T Convert_nh_64 (T x)
 Convert 64 bits value byte order from network to host byte order and vice versa. More...
 
constexpr int8_t Ntoh (int8_t x)
 Convert value from network to host byte order. More...
 
constexpr int8_t Hton (int8_t x)
 Convert value from host to network byte order. More...
 
constexpr int8_t Le (int8_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr int8_t Be (int8_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr uint8_t Ntoh (uint8_t x)
 Convert value from network to host byte order. More...
 
constexpr uint8_t Hton (uint8_t x)
 Convert value from host to network byte order. More...
 
constexpr uint8_t Le (uint8_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr uint8_t Be (uint8_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr int16_t Ntoh (int16_t x)
 Convert value from network to host byte order. More...
 
constexpr int16_t Hton (int16_t x)
 Convert value from host to network byte order. More...
 
constexpr int16_t Le (int16_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr int16_t Be (int16_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr uint16_t Ntoh (uint16_t x)
 Convert value from network to host byte order. More...
 
constexpr uint16_t Hton (uint16_t x)
 Convert value from host to network byte order. More...
 
constexpr uint16_t Le (uint16_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr uint16_t Be (uint16_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr int32_t Ntoh (int32_t x)
 Convert value from network to host byte order. More...
 
constexpr int32_t Hton (int32_t x)
 Convert value from host to network byte order. More...
 
constexpr int32_t Le (int32_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr int32_t Be (int32_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr uint32_t Ntoh (uint32_t x)
 Convert value from network to host byte order. More...
 
constexpr uint32_t Hton (uint32_t x)
 Convert value from host to network byte order. More...
 
constexpr uint32_t Le (uint32_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr uint32_t Be (uint32_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr int64_t Ntoh (int64_t x)
 Convert value from network to host byte order. More...
 
constexpr int64_t Hton (int64_t x)
 Convert value from host to network byte order. More...
 
constexpr int64_t Le (int64_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr int64_t Be (int64_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr uint64_t Ntoh (uint64_t x)
 Convert value from network to host byte order. More...
 
constexpr uint64_t Hton (uint64_t x)
 Convert value from host to network byte order. More...
 
constexpr uint64_t Le (uint64_t x)
 Convert value from LE to host byte order and vice versa. More...
 
constexpr uint64_t Be (uint64_t x)
 Convert value from BE to host byte order and vice versa. More...
 
constexpr float Hton (float x)
 Convert float type from host to network format. More...
 
constexpr float Ntoh (float x)
 Convert float type from network to host format. More...
 
constexpr double Hton (double x)
 Convert double type from host to network format. More...
 
constexpr double Ntoh (double x)
 Convert double type from network to host format. More...
 
constexpr float Le (float x)
 Convert float type from LE to host format. More...
 
constexpr float Be (float x)
 Convert float type from BE to host format. More...
 
constexpr double Le (double x)
 Convert float type from LE to host format. More...
 
constexpr double Be (double x)
 Convert float type from BE to host format. More...
 
template<class __Callable , typename... __Args>
 __DEFINE_CALLBACK_BUILDER_BODY (Make_write_callback,(Io_result),(Io_result::OTHER_FAILURE)) template< class __Callable
 Convenience builder for write operation callbacks. More...
 
template<typename... Params>
Callback< param_setter_internal::Param_setter< Params... >, void, Params... >::Ptr Make_setter (Params &...params)
 Make setter callback for provided parameters. More...
 
template<class __Callable , typename... __Args>
 __DEFINE_CALLBACK_BUILDER_BODY (Make_program_init_handler,(int, char **),(0, nullptr)) typedef Callback_proxy< void > Program_done
 Builder for init handler. More...
 
Run_as_service_result Run_as_service (const char *service_name, int argc, char *argv[], Program_init prog_init, Program_done prog_done)
 Entry point for running program as a service. More...
 
template<class __Callable , typename... __Args>
 __DEFINE_CALLBACK_BUILDER_BODY (Make_socket_connect_callback,(Socket_stream::Ref, Io_result),(nullptr, Io_result::OTHER_FAILURE)) template< class __Callable
 Convenience builder for socket connect operation callbacks. More...
 
typename __Args __DEFINE_CALLBACK_BUILDER_BODY (Make_socket_listen_callback,(Socket_listener::Ref, Io_result),(nullptr, Io_result::OTHER_FAILURE)) template< class __Callable
 Convenience builder for socket accept operation callbacks. More...
 
typename __Args typename __Args __DEFINE_CALLBACK_BUILDER_BODY (Make_socket_accept_callback,(Socket_stream::Ref, Io_result),(nullptr, Io_result::OTHER_FAILURE)) template< class __Callable
 Convenience builder for socket Read_from operation callbacks. More...
 
typename __Args typename __Args typename __Args __DEFINE_CALLBACK_BUILDER_BODY (Make_socket_read_from_callback,(Io_buffer::Ptr, Io_result, Socket_address::Ptr),(nullptr, Io_result::OTHER_FAILURE, nullptr)) template< class __Callable
 Convenience builder for Read operation callbacks. More...
 
uint32_t Get_application_instance_id ()
 Return instance id which is randomly generated on the first call.
 
uint64_t Get_random_seed ()
 Return a random number on each call. More...
 
void Initialize (const std::string &props_file="vsm.conf")
 Initialize VSM SDK. More...
 
void Initialize (int argc, char *argv[], const std::string &default_conf_file="vsm.conf")
 Initialize VSM SDK. More...
 
void Terminate (bool save_config=false)
 Terminate VSM SDK. More...
 

Variables

regex::regex_constants::syntax_option_type platform_independent_filename_regex_matching_flag
 This flag is used to support case insensitive file systems in regular expression matching. More...
 

Detailed Description

All VSM SDK functionality resides in this namespace.

Typedef Documentation

typedef Be_value<int8_t> ugcs::vsm::Be_int8

Standard primitive types for big-endian byte order.

template<typename T >
using ugcs::vsm::Be_value = typedef Bo_value<T, internal::Be_converter>

Big-endian value wrapper.

Parameters
TUnderlying primitive type.
typedef Le_value<int8_t> ugcs::vsm::Le_int8

Standard primitive types for little-endian byte order.

template<typename T >
using ugcs::vsm::Le_value = typedef Bo_value<T, internal::Le_converter>

Little-endian value wrapper.

Parameters
TUnderlying primitive type.
typedef Callback_proxy<int, int, char **> ugcs::vsm::Program_init

Signature for program initialization routine.

int Program_init(int, char **, ...); This function is called from the service main thread when program is run as a service. The function should be used to initialize the service functionality and should return within reasonable time - less than 10 seconds. Return result: 0: Tells that service initialized correctly. Service is reported as RUNNING to sc manager. non-zero: Service initialization failed. Service is reported as STOPPED to sc manager.

Request type for convenient usage.

Request processor is a request execution context where request are processed.

Examples:
async_workflow.cpp.

Request waiter type for convenient usage.

Convenience types aliases.

Position defined in WGS84 geodetic system.

Enumeration Type Documentation

enum ugcs::vsm::Io_result
strong

Result of I/O operation.

Enumerator
OK 

Operation completed successfully.

TIMED_OUT 

Operation timed out.

CANCELED 

Operation canceled.

BAD_ADDRESS 

Bad address specific.

It could not be understood and used.

CONNECTION_REFUSED 

Remote side has explicitly refused the connection.

CLOSED 

Stream has been or is closed.

All pending or new operations initiated for closed stream are completed with this result.

PERMISSION_DENIED 

Insufficient permissions for the requested operation.

END_OF_FILE 

End of file encountered.

LOCK_ERROR 

File locking error.

Possible double lock or unlock while not locked

OTHER_FAILURE 

Some other system failure.

If happened, it is recommended to investigate the root cause.

Result of Run_as_service function SERVICE_RESULT_OK = 0: Was invoked as service and is about to end.

(service has stopped).

  • OR - Service specific parameters processed successfully. Application should terminate normally on this return code.

SERVICE_RESULT_ERROR: Error while Service specific parameters processing. Application should terminate with error on this return code.

SERVICE_RESULT_NORMAL_INVOCATION -1: Was not invoked as service AND no –service* parameters given. Application should continue as if launched normally (not as service).

Function Documentation

template<class __Callable , typename... __Args>
ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_program_init_handler  ,
(int, char **)  ,
(0, nullptr)   
)

Builder for init handler.

Programs' deinit routine. Called when service is about to get stopped. Use this routine to cleanup resources.

template<class __Callable , typename... __Args>
ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_write_callback  ,
(Io_result ,
(Io_result::OTHER_FAILURE  
)

Convenience builder for write operation callbacks.

Convenience builder for read operation callbacks.

template<class __Callable , typename... __Args>
ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_socket_connect_callback  ,
(Socket_stream::Ref, Io_result ,
(nullptr, Io_result::OTHER_FAILURE  
)

Convenience builder for socket connect operation callbacks.

Convenience builder for socket listen operation callbacks.

typename __Args ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_socket_listen_callback  ,
(Socket_listener::Ref, Io_result ,
(nullptr, Io_result::OTHER_FAILURE  
)

Convenience builder for socket accept operation callbacks.

typename __Args typename __Args ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_socket_accept_callback  ,
(Socket_stream::Ref, Io_result ,
(nullptr, Io_result::OTHER_FAILURE  
)

Convenience builder for socket Read_from operation callbacks.

typename __Args typename __Args typename __Args ugcs::vsm::__DEFINE_CALLBACK_BUILDER_BODY ( Make_socket_read_from_callback  ,
(Io_buffer::Ptr, Io_result, Socket_address::Ptr)  ,
(nullptr, Io_result::OTHER_FAILURE, nullptr)   
)

Convenience builder for Read operation callbacks.

constexpr int8_t ugcs::vsm::Be ( int8_t  x)

Convert value from BE to host byte order and vice versa.

constexpr uint8_t ugcs::vsm::Be ( uint8_t  x)

Convert value from BE to host byte order and vice versa.

constexpr uint16_t ugcs::vsm::Be ( uint16_t  x)

Convert value from BE to host byte order and vice versa.

constexpr int16_t ugcs::vsm::Be ( int16_t  x)

Convert value from BE to host byte order and vice versa.

constexpr int32_t ugcs::vsm::Be ( int32_t  x)

Convert value from BE to host byte order and vice versa.

constexpr uint32_t ugcs::vsm::Be ( uint32_t  x)

Convert value from BE to host byte order and vice versa.

constexpr int64_t ugcs::vsm::Be ( int64_t  x)

Convert value from BE to host byte order and vice versa.

constexpr uint64_t ugcs::vsm::Be ( uint64_t  x)

Convert value from BE to host byte order and vice versa.

constexpr float ugcs::vsm::Be ( float  x)

Convert float type from BE to host format.

constexpr double ugcs::vsm::Be ( double  x)

Convert float type from BE to host format.

template<class Callback_ptr , typename Result , typename... Args>
constexpr void ugcs::vsm::Callback_check_type ( )

Check if the specified callback type corresponds to the partial prototype.

All types are checked for implicit conversion possibility from real type to the expected one.

Template parameters:

  • Callback_ptr Type of callback pointer.
  • Result Expected result type.
  • Args Expected first arguments type.
template<typename T >
constexpr T ugcs::vsm::Convert_be_16 ( x)

Convert 16 bits value byte order from BE to host byte order and vice versa.

Template parameters:

  • T 16-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_be_32 ( x)

Convert 32 bits value byte order from BE to host byte order and vice versa.

Template parameters:

  • T 32-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_be_64 ( x)

Convert 64 bits value byte order from BE to host byte order and vice versa.

Template parameters:

  • T 64-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_be_8 ( x)

Stub for easier conversion functions generalization.

template<typename T >
constexpr T ugcs::vsm::Convert_le_16 ( x)

Convert 16 bits value byte order from LE to host byte order and vice versa.

Template parameters:

  • T 16-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_le_32 ( x)

Convert 32 bits value byte order from LE to host byte order and vice versa.

Template parameters:

  • T 32-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_le_64 ( x)

Convert 64 bits value byte order from LE to host byte order and vice versa.

Template parameters:

  • T 64-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_le_8 ( x)

Stub for easier conversion functions generalization.

template<typename T >
constexpr T ugcs::vsm::Convert_nh_16 ( x)

Convert 16 bits value byte order from network to host byte order and vice versa.

Template parameters:

  • T 16-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_nh_32 ( x)

Convert 32 bits value byte order from network to host byte order and vice versa.

Template parameters:

  • T 32-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_nh_64 ( x)

Convert 64 bits value byte order from network to host byte order and vice versa.

Template parameters:

  • T 64-bits integer type.
    Parameters
    xValue to convert.
template<typename T >
constexpr T ugcs::vsm::Convert_nh_8 ( x)

Stub for easier conversion functions generalization.

uint64_t ugcs::vsm::Get_random_seed ( )

Return a random number on each call.

Can be used to seed PRNG.

constexpr int8_t ugcs::vsm::Hton ( int8_t  x)

Convert value from host to network byte order.

constexpr uint8_t ugcs::vsm::Hton ( uint8_t  x)

Convert value from host to network byte order.

constexpr uint16_t ugcs::vsm::Hton ( uint16_t  x)

Convert value from host to network byte order.

constexpr int16_t ugcs::vsm::Hton ( int16_t  x)

Convert value from host to network byte order.

constexpr int32_t ugcs::vsm::Hton ( int32_t  x)

Convert value from host to network byte order.

constexpr uint32_t ugcs::vsm::Hton ( uint32_t  x)

Convert value from host to network byte order.

constexpr int64_t ugcs::vsm::Hton ( int64_t  x)

Convert value from host to network byte order.

constexpr uint64_t ugcs::vsm::Hton ( uint64_t  x)

Convert value from host to network byte order.

constexpr float ugcs::vsm::Hton ( float  x)

Convert float type from host to network format.

constexpr double ugcs::vsm::Hton ( double  x)

Convert double type from host to network format.

void ugcs::vsm::Initialize ( const std::string &  props_file = "vsm.conf")

Initialize VSM SDK.

This function should be called before using any API.

Parameters
props_fileName of the configuration file, 'vsm.conf' is the default.
Exceptions
Invalid_param_exceptionif configuration file cannot be opened.
Properties::Parse_exceptionif the configuration file has invalid format.
Properties::Not_found_exceptionif required entries are missing in the configuration file.
Properties::Not_convertible_exceptionif configuration entries has invalid format (e.g. invalid string where integer value is required).
Examples:
async_workflow.cpp.
void ugcs::vsm::Initialize ( int  argc,
char *  argv[],
const std::string &  default_conf_file = "vsm.conf" 
)

Initialize VSM SDK.

This function should be called before using any API. This function parses the argument list and initializes vsm according to them. Supported arguments:

–config <confguration file name>

Parameters
argcargument count in argv array
argvargument list
default_conf_fileDefault configuration file name if not specified via arguments.
Exceptions
Invalid_param_exceptionif configuration file cannot be opened.
Properties::Parse_exceptionif the configuration file has invalid format.
Properties::Not_found_exceptionif required entries are missing in the configuration file.
Properties::Not_convertible_exceptionif configuration entries has invalid format (e.g. invalid string where integer value is required).
constexpr bool ugcs::vsm::Is_system_be ( )

Check if the system is big-endian.

constexpr bool ugcs::vsm::Is_system_le ( )

Check if the system is little-endian.

constexpr int8_t ugcs::vsm::Le ( int8_t  x)

Convert value from LE to host byte order and vice versa.

constexpr uint8_t ugcs::vsm::Le ( uint8_t  x)

Convert value from LE to host byte order and vice versa.

constexpr int16_t ugcs::vsm::Le ( int16_t  x)

Convert value from LE to host byte order and vice versa.

constexpr uint16_t ugcs::vsm::Le ( uint16_t  x)

Convert value from LE to host byte order and vice versa.

constexpr int32_t ugcs::vsm::Le ( int32_t  x)

Convert value from LE to host byte order and vice versa.

constexpr uint32_t ugcs::vsm::Le ( uint32_t  x)

Convert value from LE to host byte order and vice versa.

constexpr uint64_t ugcs::vsm::Le ( uint64_t  x)

Convert value from LE to host byte order and vice versa.

constexpr int64_t ugcs::vsm::Le ( int64_t  x)

Convert value from LE to host byte order and vice versa.

constexpr float ugcs::vsm::Le ( float  x)

Convert float type from LE to host format.

constexpr double ugcs::vsm::Le ( double  x)

Convert float type from LE to host format.

template<class Callable , typename... Args>
Callback<Callable, void, Args...>::Ptr ugcs::vsm::Make_callback ( Callable &&  callable,
Args &&...  args 
)

Create a callback.

Parameters
callableAny callable object type (function, lambda, class with overloaded call operator etc.). It may be a class member function pointer. In this case the first argument should be object instance pointer (may be any object which can be used with pointer semantic).
argsArguments pack.
Returns
Callback specified with user arguments.
See also
Callback
Examples:
async_workflow.cpp.
template<class Result , typename... Args>
callback_internal::Dummy_callback_helper<Result, Args...>::Callback_type::Ptr ugcs::vsm::Make_dummy_callback ( )

Create dummy callback.

Such callback can be used as placeholder, for example, in default value for handler argument. It uses default constructor for mandatory arguments and return value. It does nothing when fired. Template parameters:

  • Result Type of return value.
  • Args Types for mandatory arguments if any.
template<typename... Params>
Callback<param_setter_internal::Param_setter<Params...>, void, Params...>::Ptr ugcs::vsm::Make_setter ( Params &...  params)

Make setter callback for provided parameters.

It can be used as a convenience callback which just sets all provided parameters to the arguments values when invoked.

Parameters
paramsReferences to the parameters storage.
Returns
Callback object which returns void type and accepts values for the provided parameters.
constexpr int8_t ugcs::vsm::Ntoh ( int8_t  x)

Convert value from network to host byte order.

constexpr uint8_t ugcs::vsm::Ntoh ( uint8_t  x)

Convert value from network to host byte order.

constexpr uint16_t ugcs::vsm::Ntoh ( uint16_t  x)

Convert value from network to host byte order.

constexpr int16_t ugcs::vsm::Ntoh ( int16_t  x)

Convert value from network to host byte order.

constexpr uint32_t ugcs::vsm::Ntoh ( uint32_t  x)

Convert value from network to host byte order.

constexpr int32_t ugcs::vsm::Ntoh ( int32_t  x)

Convert value from network to host byte order.

constexpr int64_t ugcs::vsm::Ntoh ( int64_t  x)

Convert value from network to host byte order.

constexpr uint64_t ugcs::vsm::Ntoh ( uint64_t  x)

Convert value from network to host byte order.

constexpr float ugcs::vsm::Ntoh ( float  x)

Convert float type from network to host format.

constexpr double ugcs::vsm::Ntoh ( double  x)

Convert double type from network to host format.

Run_as_service_result ugcs::vsm::Run_as_service ( const char *  service_name,
int  argc,
char *  argv[],
Program_init  prog_init,
Program_done  prog_done 
)

Entry point for running program as a service.

This function should be the first called from program's main(). argc and argv from main() should be passed unchanged to the function.

The program must be run as Administrator for –service commands to succeed.

When launched from command line (not as a service) this function recognizes the following arguments from argv array: –service create|delete|start|stop|restart [–service-startup-mode auto|manual] \ –service-description "Quoted text describing the service" –config <path_to_vsm_config_file>

-service create 1) Creates the service with given name and sets startup mode according to "--service-startup-mode" argument. Starts the service if startup mode is set to auto. 2) Saves the rest of given parameters in registry (excluding the "-service \<action\>" and "--service-startup-mode \<mode\>"). 3) –config <file> is treated in a special way: a) "vsm.conf" is used when –config parameter not present. b) File name is converted to absolute path. 4) If config file is not accessible the service is not created and the call fails.

–service delete Stops and removes the service from registry. (The same as running Windows command 'sc delete <service_name>')

–service start Starts the service (The same as running Windows command 'sc start <service_name>')

–service stop Stop the service (The same as running Windows command 'sc stop <service_name>')

–service restart Stop and start the service. Used when config has changed. (The same as running Windows commands 'sc stop <service_name>' and then 'sc start <service_name>') To run the service with different config file path it must be reinstalled using -service delete and -service create calls

–service state Display current state of service: Running, Stopped, ...

–service-startup-mode manual (default) Used together with "--service create" command Service will require manual start with 'sc start <service_name>' command or '<program> –service start' command. This is the default mode when –service-startup-mode parameter not given.

–service-startup-mode auto Used together with "--service create" command Start service automatically when Windows starts

–service-description "quoted string" Used to specify service description. This text will appear in Windows Service manager console

–service-account "quoted string" Used to specify account which will run the service.

–service-password "quoted string" Used to specify password for service account.

When the program main is invoked as a service then Run_as_windows_service() returns only when the service is stopped. The return value is SERVICE_RESULT_OK.

Parameters
service_nameName of the service this program will implement.
argcParameter count.
argvParameter string values (ANSI only, localized strings not supported)
prog_initFunction to call on service startup (required)
prog_doneFunction to call on service stop. Can be NULL.
Returns
true - service specific parameters were found and handled successfully. when run as service, the program is going to stop. Basically, your main function should exit right after this call returned true. false - no service specific parameters found and not invoked as service In this case your program can continue as normal console app.
void ugcs::vsm::Terminate ( bool  save_config = false)

Terminate VSM SDK.

This function should be called when VSM is termination. VSM SDK API cannot be used after that.

Parameters
save_configIndicates that VSM configuration file should be saved so that changes done in run-time will be persisted.
Examples:
async_workflow.cpp.

Variable Documentation

regex::regex_constants::syntax_option_type ugcs::vsm::platform_independent_filename_regex_matching_flag

This flag is used to support case insensitive file systems in regular expression matching.

defined as regex::regex_constants::icase on windows (Ignore case when matching patterns) defined as regex::regex_constants::none on linux (All matching is case sensitive)