- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::StructTypeInterface Class Referenceabstract

`#include <typeinterface.hpp>`

## Public Member Functions
AnyReferenceVector | values (void *storage)
| Get all the fields of the structure. More...
virtual std::vector < TypeInterface * > | memberTypes ()=0
virtual std::vector< void * > | get (void *storage)
| Get all the fields storages of the struct (not a copy) More...
virtual void * | get (void *storage, unsigned int index)=0
| Get the field storage at index (not a copy) More...
virtual void | set (void **storage, const std::vector< void * > &)
| Set all the fields of the struct (copies the values given in the vector) More...
virtual void | set (void **storage, unsigned int index, void *valStorage)=0
| Set the fields of the struct at index (copies the value given) More...
TypeKind | kind () override
virtual std::vector< std::string > | elementsName ()
| Get the names of the fields of the struct. More...
virtual std::string | className ()
| Get the type name of the struct. More...
virtual bool | convertFrom (std::map< std::string,::qi::AnyValue > &fields, const std::vector< std::tuple< std::string, TypeInterface * >> &missing, const std::map< std::string,::qi::AnyReference > &dropfields)
| Fill missing fields caused by conversion from a different struct. Return whether fill succeeded. More...
virtual bool | convertTo (std::map< std::string,::qi::AnyValue > &fields, const std::vector< std::tuple< std::string, TypeInterface * >> &missing, const std::map< std::string,::qi::AnyReference > &dropfields)
| Fill missing fields caused by conversion to a different struct. Return whether fill succeeded. More...
Public Member Functions inherited from qi::TypeInterface
virtual | ~TypeInterface ()=default
virtual const TypeInfo & | info ()=0
| Get the TypeInfo corresponding to this type. More...
virtual void * | initializeStorage (void *ptr=nullptr)=0
virtual void * | ptrFromStorage (void **)=0
virtual void * | clone (void *)=0
| Allocate a storage and copy the value given as an argument. More...
virtual void | destroy (void *)=0
| Free all resources of a storage. More...
virtual bool | less (void *a, void *b)=0
const char * | infoString ()
qi::Signature | signature (void *storage=nullptr, bool resolveDynamic=false)

## Additional Inherited Members
Static Public Member Functions inherited from qi::TypeInterface
static TypeInterface * | fromSignature (const qi::Signature &sig)

## Detailed Description

Definition at line 241 of file typeinterface.hpp.

## Member Function Documentation

virtual std::string qi::StructTypeInterface::className | ( |  | ) |
| inline virtual

Get the type name of the struct.

Definition at line 266 of file typeinterface.hpp.

virtual bool qi::StructTypeInterface::convertFrom | ( | std::map< std::string,::qi::AnyValue > & | fields,
|  | const std::vector< std::tuple< std::string, TypeInterface * >> & | missing,
|  | const std::map< std::string,::qi::AnyReference > & | dropfields
| ) |  |
| inline virtual

Fill missing fields caused by conversion from a different struct. Return whether fill succeeded.

Versioning support.

Conversion between non-equivalent structs will be attempted if all fields are named: fields with matching names will be automatically mapped to each other.

convertFrom(fields, missing, dropFields) will be called on the target, with a map of fields that were converted, the list of missing field names and typeinterfaces and the list of fields that are being dropped. The function must fill fields with a value for each of the missing fields, or return false (no storage is provided, because the struct cant be instanciated without a value for all fields being available.

convertTo is called the same way when converting this structure to another.

Definition at line 288 of file typeinterface.hpp.

virtual bool qi::StructTypeInterface::convertTo | ( | std::map< std::string,::qi::AnyValue > & | fields,
|  | const std::vector< std::tuple< std::string, TypeInterface * >> & | missing,
|  | const std::map< std::string,::qi::AnyReference > & | dropfields
| ) |  |
| inline virtual

Fill missing fields caused by conversion to a different struct. Return whether fill succeeded.

Definition at line 295 of file typeinterface.hpp.

virtual std::vector<std::string> qi::StructTypeInterface::elementsName | ( |  | ) |
| inline virtual

Get the names of the fields of the struct.

Reimplemented in qi::StructTypeInterfaceBouncer< T, TO >.

Definition at line 264 of file typeinterface.hpp.

virtual std::vector<void*> qi::StructTypeInterface::get | ( | void * | storage | ) |
| virtual

Get all the fields storages of the struct (not a copy)

Reimplemented in qi::StructTypeInterfaceBouncer< T, TO >.

virtual void* qi::StructTypeInterface::get | ( | void * | storage,
|  | unsigned int | index
| ) |  |
| pure virtual

Get the field storage at index (not a copy)

Implemented in qi::TypeImpl< std::pair< F, S > >, and qi::StructTypeInterfaceBouncer< T, TO >.

TypeKind qi::StructTypeInterface::kind | ( |  | ) |
| inline override virtual

Get the kind of the data.

This is used to downcast the TypeInterface object to a specialized interface.

Reimplemented from qi::TypeInterface.

Definition at line 262 of file typeinterface.hpp.

virtual std::vector<TypeInterface*> qi::StructTypeInterface::memberTypes | ( |  | ) |
| pure virtual

Get all the member types

Note that this function does not recieve a storage argument. There must be one instance of StructTypeInterface per type of struct. If you need dynamic structs, look at makeTupleType().

Implemented in qi::TypeImpl< std::pair< F, S > >, and qi::StructTypeInterfaceBouncer< T, TO >.

virtual void qi::StructTypeInterface::set | ( | void ** | storage,
|  | const std::vector< void * > & |
| ) |  |
| virtual

Set all the fields of the struct (copies the values given in the vector)

Reimplemented in qi::StructTypeInterfaceBouncer< T, TO >.

virtual void qi::StructTypeInterface::set | ( | void ** | storage,
|  | unsigned int | index,
|  | void * | valStorage
| ) |  |
| pure virtual

Set the fields of the struct at index (copies the value given)

Implemented in qi::TypeImpl< std::pair< F, S > >, and qi::StructTypeInterfaceBouncer< T, TO >.

AnyReferenceVector qi::StructTypeInterface::values | ( | void * | storage | ) |

Get all the fields of the structure.

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

- /home/opennao/work/release-2.8/sdk/libqi/qi/type/typeinterface.hpp