libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::MapTypeInterface Class Referenceabstract

#include <typeinterface.hpp>

Public Member Functions

virtual TypeInterfaceelementType ()=0
 Get the types of the values of the map. More...
 
virtual TypeInterfacekeyType ()=0
 Get the types of the keys of the map. More...
 
virtual size_t size (void *storage)=0
 Return the number of elements in the map. More...
 
virtual AnyIterator begin (void *storage)=0
 Return an iterator pointing to the first key-value pair of the map. More...
 
virtual AnyIterator end (void *storage)=0
 
virtual void insert (void **storage, void *keyStorage, void *valueStorage)=0
 Set a key to a value and creates it if it does not exist. More...
 
virtual AnyReference element (void **storage, void *keyStorage, bool autoInsert)=0
 
TypeKind kind () override
 
- Public Member Functions inherited from qi::TypeInterface
virtual ~TypeInterface ()=default
 
virtual const TypeInfoinfo ()=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 TypeInterfacefromSignature (const qi::Signature &sig)
 

Detailed Description

Interface for a map of elements (like std::map)

Keys must have the same types and values must have the same types (both may be dynamic)

Definition at line 213 of file typeinterface.hpp.

Member Function Documentation

virtual AnyIterator qi::MapTypeInterface::begin ( void *  storage)
pure virtual

Return an iterator pointing to the first key-value pair of the map.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

virtual AnyReference qi::MapTypeInterface::element ( void **  storage,
void *  keyStorage,
bool  autoInsert 
)
pure virtual

Get the value corresponding to the requested key

If the key does not exist and autoInsert is true, it is created, otherwise an invalid reference is returned.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

virtual TypeInterface* qi::MapTypeInterface::elementType ( )
pure virtual

Get the types of the values of the map.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

virtual AnyIterator qi::MapTypeInterface::end ( void *  storage)
pure virtual

Return an iterator pointing to one past the last key-value pair of the list (do not dereference this iterator!)

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

virtual void qi::MapTypeInterface::insert ( void **  storage,
void *  keyStorage,
void *  valueStorage 
)
pure virtual

Set a key to a value and creates it if it does not exist.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

virtual TypeInterface* qi::MapTypeInterface::keyType ( )
pure virtual

Get the types of the keys of the map.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.

TypeKind qi::MapTypeInterface::kind ( )
inlineoverridevirtual

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 236 of file typeinterface.hpp.

virtual size_t qi::MapTypeInterface::size ( void *  storage)
pure virtual

Return the number of elements in the map.

Implemented in qi::MapTypeInterfaceImpl< M >, and qi::MapTypeInterfaceImpl< std::map< K, V, C, A > >.


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