120 {
122 {
123 LOG_ERROR(
"size of buff(" << buff.size() <<
") is too small, at load_struct_from_levin_message");
124 return false;
125 }
126
127#if BYTE_ORDER == LITTLE_ENDIAN
129#else
137#endif
139 {
140 LOG_ERROR(
"Failed to read signature in levin message, at load_struct_from_levin_message");
141 return false;
142 }
143 if(
head.m_cb != buff.size()-
sizeof(levin::bucket_head))
144 {
145 LOG_ERROR(
"sizes mismatch, at load_struct_from_levin_message");
146 return false;
147 }
148
149 std::string buff_strg;
150 buff_strg.assign(&buff[sizeof(levin::bucket_head)], buff.size()-sizeof(levin::bucket_head));
151
152 if(!StorageNamed::load_struct_from_storage_buff_t<t_struct, StorageNamed::DefaultStorageType>(t, buff_strg))
153 {
154 LOG_ERROR(
"Failed to read storage, at load_struct_from_levin_message");
155 return false;
156 }
157 command =
head.m_command;
158 return true;
159 }