dronecode_sdk::Info Class Reference

#include: info.h


The Info class provides basic infomation about the hardware and/or software of a system.

Data Structures

struct Identification

struct Product

struct Version

Public Types

Type Description
enum Result Possible results returned for requests.

Public Member Functions

Type Name Description
  Info (System & system) Constructor. Creates the plugin for a specific System.
  ~Info () Destructor (internal use only).
  Info (const Info &)=delete Copy Constructor (object is not copyable).
std::pair< Result, Identification > get_identification () const Gets the identification of the system.
std::pair< Result, Version > get_version () const Get system version information.
std::pair< Result, Product > get_product () const Get system product information.
const Info & operator= (const Info &)=delete Equality operator (object is not copyable).

Static Public Attributes

static const unsigned GIT_HASH_STR_LEN = 17 - Length of git hash strings.

Static Public Member Functions

Type Name Description
std::string result_str (Result result) Returns a human-readable English string for an Result.

Constructor & Destructor Documentation

Info()

dronecode_sdk::Info::Info(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto info = std::make_shared<Info>(system);

Parameters

  • System& system - The specific system associated with this plugin.

~Info()

dronecode_sdk::Info::~Info()

Destructor (internal use only).

Info()

dronecode_sdk::Info::Info(const Info &)=delete

Copy Constructor (object is not copyable).

Parameters

Member Enumeration Documentation

enum Result

Possible results returned for requests.

DronecodeSDK does not throw exceptions. Instead a result of this type will be returned.

Value Description
UNKNOWN Unspecified error.
SUCCESS The request was successful.
INFORMATION_NOT_RECEIVED_YET The information has not been received yet.

Member Function Documentation

get_identification()

std::pair<Result, Identification> dronecode_sdk::Info::get_identification() const

Gets the identification of the system.

If possible this will be a unique identifier provided by hardware.

Returns

 std::pair< Result, Identification > - a pair containing the result of the request and if successful, the identification information of the system.

get_version()

std::pair<Result, Version> dronecode_sdk::Info::get_version() const

Get system version information.

Returns

 std::pair< Result, Version > - a pair containing the result of the request and if successful, the version information about the system.

get_product()

std::pair<Result, Product> dronecode_sdk::Info::get_product() const

Get system product information.

Returns

 std::pair< Result, Product > - a pair containing the result of the request and if successful, the product information about the system.

operator=()

const Info& dronecode_sdk::Info::operator=(const Info &)=delete

Equality operator (object is not copyable).

Parameters

Returns

 const Info & -

result_str()

static std::string dronecode_sdk::Info::result_str(Result result)

Returns a human-readable English string for an Result.

Parameters

  • Result result - The enum value for which a human readable string is required.

Returns

 std::string - Human readable string for the Result.

Field Documentation

GIT_HASH_STR_LEN

const unsigned dronecode_sdk::Info::GIT_HASH_STR_LEN = 17

Length of git hash strings.

Length is 16 chars + null termination.

© Dronecode 2017. License: CC BY 4.0            Updated: 2019-03-25 09:27:24

results matching ""

    No results matching ""