9 #ifndef _MADARA_KNOWLEDGE_GET_RECORD_H_
10 #define _MADARA_KNOWLEDGE_GET_RECORD_H_
28 using MadaraException::MadaraException;
37 using InvalidGetException::InvalidGetException;
47 using InvalidGetException::InvalidGetException;
71 typename std::enable_if<std::is_integral<T>::value,
bool>
::type
78 typename std::enable_if<std::is_floating_point<T>::value,
bool>::type
90 typename std::enable_if<std::is_integral<T>::value,
bool>::type
97 typename std::enable_if<std::is_floating_point<T>::value,
bool>::type
126 "KnowledgeRecord does not exist");
131 "madara::knowledge::get: "
132 "Expected type does not match the KnowledgeRecord's type (" +
133 std::to_string(kr.
type()) +
")");
136 return knowledge_cast<T>(kr);
A base class for exceptions thrown by knowledge::get.
Base exception for all custom Madara exceptions.
Exception thrown when attempting to retrieve a value from a record of the wrong type.
Exception thrown when a attempting to retrieve a value from an empty record.
This class encapsulates an entry in a KnowledgeBase.
uint32_t type(void) const
returns the type of the value
bool exists(void) const
Checks if record exists (i.e., is not uncreated)
Provides functions and classes for the distributed knowledge base.
bool type_match(type< T > t, const KnowledgeRecord &kr)
Check if a KnowledgeRecord type matches a specified type.
T get(const KnowledgeRecord &kr)
Get the value of a KnowlegeRecord.
Copyright(c) 2020 Galois.