cppDataPipeline 0.3.0
C++ Implementation of the FAIR Data Pipeline API
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
FairDataPipeline::ApiObject Class Reference

Class for API objects. More...

#include <fdp/objects/api_object.hxx>

Public Types

typedef std::shared_ptr< ApiObjectsptr
 

Public Member Functions

int add (const std::string &key, int value)
 
int add (const std::string &key, float value)
 
int add (const std::string &key, double value)
 
int add (const std::string &key, const std::string &value)
 
int add (const std::string &key, const ApiObject &value)
 
int remove (const std::string &key)
 
int get_id () const
 Get the object id from the uri. More...
 
std::string get_type () const
 Returns the object type from the object uri_ (table) More...
 
std::string get_uri () const
 Get the object uri. More...
 
std::string get_value_as_string (const std::string &key) const
 Get the value of a given key as string object. More...
 
int get_value_as_int (const std::string &key) const
 Get the value of a given key as int object. More...
 
std::string get_first_component () const
 Get the first component of the object. More...
 
bool is_empty ()
 Check to see if the object is empty. More...
 

Static Public Member Functions

static sptr from_json (const Json::Value &j)
 
static ApiObject::sptr construct (void)
 Construct a new Api Object object. More...
 
static int get_id_from_string (std::string url)
 Get the object type from the uri. More...
 

Detailed Description

Class for API objects.

Member Function Documentation

◆ construct()

ApiObject::sptr FairDataPipeline::ApiObject::construct ( void  )
static

Construct a new Api Object object.

Parameters
uriuri of the api object e.g. http://127.0.0.1/object/1

◆ get_first_component()

std::string FairDataPipeline::ApiObject::get_first_component ( ) const

Get the first component of the object.

Returns
std::string

◆ get_id()

int FairDataPipeline::ApiObject::get_id ( ) const

Get the object id from the uri.

Returns the object id from the object uri_.

Returns
int object id e.g. if the uri is http://127.0.0.1/object/1 the object id will be 1
Returns
int of the object id

◆ get_id_from_string()

int FairDataPipeline::ApiObject::get_id_from_string ( std::string  url)
static

Get the object type from the uri.

Returns
std::string the object type (table) e.g. if the uri is http://127.0.0.1/object/1 the object type will be object

◆ get_type()

std::string FairDataPipeline::ApiObject::get_type ( ) const

Returns the object type from the object uri_ (table)

Returns
std::string The object type

◆ get_uri()

std::string FairDataPipeline::ApiObject::get_uri ( ) const

Get the object uri.

Returns
std::string the uri of the object e.g. http://127.0.0.1/object/1

◆ get_value_as_int()

int FairDataPipeline::ApiObject::get_value_as_int ( const std::string &  key) const

Get the value of a given key as int object.

Parameters
key
Returns
int

◆ get_value_as_string()

std::string FairDataPipeline::ApiObject::get_value_as_string ( const std::string &  key) const

Get the value of a given key as string object.

Parameters
key
Returns
std::string

◆ is_empty()

bool FairDataPipeline::ApiObject::is_empty ( )

Check to see if the object is empty.

Returns
true the object does not contain any data
false the object contains data

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