NDDEM
Public Types | Public Member Functions | Public Attributes | List of all members
cereal::MapItem< Key, Value > Struct Template Reference

A wrapper around a key and value for serializing data into maps. More...

#include <helpers.hpp>

Public Types

using KeyType = typename std::conditional< std::is_lvalue_reference< Key >::value, Key, typename std::decay< Key >::type >::type
 
using ValueType = typename std::conditional< std::is_lvalue_reference< Value >::value, Value, typename std::decay< Value >::type >::type
 

Public Member Functions

 MapItem (Key &&key_, Value &&value_)
 Construct a MapItem from a key and a value. More...
 
MapItemoperator= (MapItem const &)=delete
 
template<class Archive >
void CEREAL_SERIALIZE_FUNCTION_NAME (Archive &archive)
 Serialize the MapItem with the NVPs "key" and "value". More...
 

Public Attributes

KeyType key
 
ValueType value
 

Detailed Description

template<class Key, class Value>
struct cereal::MapItem< Key, Value >

A wrapper around a key and value for serializing data into maps.

This class just provides a grouping of keys and values into a struct for human readable archives. For example, XML archives will use this wrapper to write maps like so:

<mymap>
<item0>
<key>MyFirstKey</key>
<value>MyFirstValue</value>
</item0>
<item1>
<key>MySecondKey</key>
<value>MySecondValue</value>
</item1>
</mymap>
See also
make_map_item

Member Typedef Documentation

◆ KeyType

template<class Key , class Value >
using cereal::MapItem< Key, Value >::KeyType = typename std::conditional< std::is_lvalue_reference<Key>::value, Key, typename std::decay<Key>::type>::type

◆ ValueType

template<class Key , class Value >
using cereal::MapItem< Key, Value >::ValueType = typename std::conditional< std::is_lvalue_reference<Value>::value, Value, typename std::decay<Value>::type>::type

Constructor & Destructor Documentation

◆ MapItem()

template<class Key , class Value >
cereal::MapItem< Key, Value >::MapItem ( Key &&  key_,
Value &&  value_ 
)
inline

Construct a MapItem from a key and a value.

Member Function Documentation

◆ CEREAL_SERIALIZE_FUNCTION_NAME()

template<class Key , class Value >
template<class Archive >
void cereal::MapItem< Key, Value >::CEREAL_SERIALIZE_FUNCTION_NAME ( Archive &  archive)
inline

Serialize the MapItem with the NVPs "key" and "value".

◆ operator=()

template<class Key , class Value >
MapItem& cereal::MapItem< Key, Value >::operator= ( MapItem< Key, Value > const )
delete

Member Data Documentation

◆ key

template<class Key , class Value >
KeyType cereal::MapItem< Key, Value >::key

◆ value

template<class Key , class Value >
ValueType cereal::MapItem< Key, Value >::value

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