1 #ifndef ISPN_HOTROD_BASICMARSHALLER_H
2 #define ISPN_HOTROD_BASICMARSHALLER_H
11 namespace infinispan {
22 void marshall(
const T& s, std::vector<char>& b) {
23 #if __GNUG__ && __GNUC__ < 5
24 static_assert(std::is_fundamental<T>::value,
"Type is not fundamental. A marshaller specialization is needed");
26 static_assert(std::is_trivially_copyable<T>::value,
"Type is not trivially_copyable. A marshaller specialization is needed");
29 std::memcpy(b.data(), &s,
sizeof(s));
32 #if __GNUG__ && __GNUC__ < 5
33 static_assert(std::is_fundamental<T>::value,
"Type is not trivially_copyable. A marshaller specialization is needed");
35 static_assert(std::is_trivially_copyable<T>::value,
"Type is not trivially_copyable. A marshaller specialization is needed");
38 std::memcpy(s, b.data(),
sizeof(*s));
46 static void release(std::vector<char> *buf) {
57 void marshall(
const std::string& s, std::vector<char>& b) {
58 b.assign(s.data(), s.data()+s.size());
61 std::string* s =
new std::string(b.data(), b.size());
static void release(std::vector< char > *buf)
Definition: BasicMarshaller.h:46
std::string * unmarshall(const std::vector< char > &b)
Definition: BasicMarshaller.h:60
void marshall(const T &s, std::vector< char > &b)
Definition: BasicMarshaller.h:22
void marshall(const std::string &s, std::vector< char > &b)
Definition: BasicMarshaller.h:57
Definition: BasicMarshaller.h:19
Definition: BasicMarshaller.h:43
static void noRelease(std::vector< char > *)
Definition: BasicMarshaller.h:45
T * unmarshall(const std::vector< char > &b)
Definition: BasicMarshaller.h:31
Definition: Marshaller.h:9