esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ndnph::PacketStore< T > Class Template Reference

File based packet store. More...

#include <packet.hpp>

Inherits ndnph::KvStore.

Public Member Functions

get (const char *key, Region &region)
 Retrieve a packet. More...
 
template<typename Encodable >
bool set (const char *key, Encodable value, Region &region)
 Store a packet. More...
 
 KvStore ()=default
 Constructor to use internal FileStore instance. More...
 
 KvStore (port::FileStore &fs)
 Constructor to use existing FileStore instance. More...
 
- Public Member Functions inherited from ndnph::KvStore
 KvStore ()=default
 Constructor to use internal FileStore instance. More...
 
 KvStore (port::FileStore &fs)
 Constructor to use existing FileStore instance. More...
 
template<typename... Arg>
bool open (Arg &&... arg)
 Open the FileStore backend. More...
 
tlv::Value get (const char *key, Region &region)
 Retrieve a value. More...
 
bool set (const char *key, tlv::Value value)
 Store a value. More...
 
bool del (const char *key)
 Delete a key. More...
 

Detailed Description

template<typename T>
class ndnph::PacketStore< T >

File based packet store.

Template Parameters
Tpacket type, which must be default-constructible and decodable.

Member Function Documentation

◆ get()

template<typename T >
T ndnph::PacketStore< T >::get ( const char *  key,
Region region 
)
inline

Retrieve a packet.

Parameters
keynon-empty key.
regionwhere to allocate memory.
Returns
the packet. Empty packet upon error.

◆ KvStore() [1/2]

template<typename T >
ndnph::KvStore::KvStore
explicitdefault

Constructor to use internal FileStore instance.

◆ KvStore() [2/2]

template<typename T >
ndnph::KvStore::KvStore
inlineexplicit

Constructor to use existing FileStore instance.

◆ set()

template<typename T >
template<typename Encodable >
bool ndnph::PacketStore< T >::set ( const char *  key,
Encodable  value,
Region region 
)
inline

Store a packet.

Parameters
keynon-empty key.
valuethe packet, which must be encodable.
regionwhere to allocate scratch memory for encoding the packet.
Returns
whether success.

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