VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm::Vehicle_request Class Reference

Base class of a generic request for a vehicle. More...

#include <vehicle_request.h>

Inheritance diagram for ugcs::vsm::Vehicle_request:
ugcs::vsm::Vehicle_request_spec< Payload > ugcs::vsm::Vehicle_request_spec< void >

Classes

class  Handle
 Handle of the request passed to the SDK user. More...
 

Public Types

enum  Result { Result::OK, Result::NOK }
 Request completion result. More...
 
typedef std::shared_ptr< Vehicle_requestPtr
 Pointer type.
 
typedef std::weak_ptr< Vehicle_requestWeak_ptr
 Pointer type.
 
typedef Callback_proxy< void, Result, std::string > Completion_handler
 Completion handler type of the request. More...
 

Public Member Functions

 Vehicle_request (Completion_handler completion_handler, Request_completion_context::Ptr completion_ctx)
 Construct base request instance. More...
 
virtual ~Vehicle_request ()
 Make sure class is polymorphic. More...
 
void Set_completion_result (Result result, const std::string &)
 Set completion result to be used when Complete method is called. More...
 
void Complete ()
 Should be called when vehicle request is completed by the user. More...
 
void Abort ()
 Abort the request. More...
 
Result Get_completion_result ()
 Get current completion result. More...
 
bool Is_completed () const
 Check if the request was completed. More...
 
void Add_ref ()
 Add reference from user handle. More...
 
void Release_ref ()
 Release reference from user handle. More...
 

Static Public Member Functions

template<typename... Args>
static Ptr Create (Args &&...args)
 Create an instance. More...
 

Friends

class Vehicle
 

Detailed Description

Base class of a generic request for a vehicle.

It provides reference management methods for associated handles.

Member Typedef Documentation

Completion handler type of the request.

Member Enumeration Documentation

Request completion result.

Enumerator
OK 

Completed successfully.

NOK 

Processing failed.

Constructor & Destructor Documentation

ugcs::vsm::Vehicle_request::Vehicle_request ( Completion_handler  completion_handler,
Request_completion_context::Ptr  completion_ctx 
)

Construct base request instance.

virtual ugcs::vsm::Vehicle_request::~Vehicle_request ( )
virtual

Make sure class is polymorphic.

Member Function Documentation

void ugcs::vsm::Vehicle_request::Abort ( )

Abort the request.

Any pending or submitted processing or completion handler is aborted, if it is not yet being executed.

void ugcs::vsm::Vehicle_request::Add_ref ( )

Add reference from user handle.

void ugcs::vsm::Vehicle_request::Complete ( )

Should be called when vehicle request is completed by the user.

Result, previously set by Set_completion_result is used.

template<typename... Args>
static Ptr ugcs::vsm::Vehicle_request::Create ( Args &&...  args)
inlinestatic

Create an instance.

Result ugcs::vsm::Vehicle_request::Get_completion_result ( )

Get current completion result.

bool ugcs::vsm::Vehicle_request::Is_completed ( ) const

Check if the request was completed.

void ugcs::vsm::Vehicle_request::Release_ref ( )

Release reference from user handle.

When last references is released, request is automatically completed with currently set result.

void ugcs::vsm::Vehicle_request::Set_completion_result ( Result  result,
const std::string &   
)

Set completion result to be used when Complete method is called.

Parameters
resultResult for Complete method.

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