CameraIdentifier Class Reference

Used to identify a specific camera in the Fusion API. More...

Functions

 CameraIdentifier ()
 
 CameraIdentifier (uint64_t sn_)
 
sl::String get () const
 
bool save (const String &filename) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (const String &filename)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content)
 Fill the structure from the serialized json object contained in the input string. More...
 

Attributes

uint64_t sn
 

Detailed Description

Used to identify a specific camera in the Fusion API.

Constructor and Destructor

◆ CameraIdentifier() [1/2]

CameraIdentifier ( )
inline

◆ CameraIdentifier() [2/2]

CameraIdentifier ( uint64_t  sn_)
inline

Functions

◆ get()

sl::String get ( ) const
inline

◆ save()

bool save ( const String filename) const

Saves the current set of parameters into a file to be reloaded with the load() method.

Parameters
filename: Name of the file which will be created to store the parameters (extension '.json' will be added if not set).
Returns
True if the file was successfully saved, otherwise false.
Warning
For security reasons, the file must not already exist.
In case a file already exists, the method will return false and existing file will not be updated.

◆ load()

bool load ( const String filename)

Loads a set of parameters from the values contained in a previously saved file.

Parameters
filename: Path to the file from which the parameters will be loaded (extension '.json' will be added at the end of the filename if not detected).
Returns
True if the file was successfully loaded, otherwise false.

◆ encode()

bool encode ( String serialized_content) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
Returns
True if the decoding was successful, otherwise false.

Variables

◆ sn

uint64_t sn

Referenced by sl::operator!=(), and sl::operator==().