DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
cmdlib
include
cmdlib
cmd
Structs.hpp
Go to the documentation of this file.
1
/*
2
* This file is 100% generated. Any manual edits will likely be lost.
3
*
4
* This contains struct and other type definitions for shema in
5
* namespace dunedaq::cmdlib::cmd.
6
*/
7
#ifndef DUNEDAQ_CMDLIB_CMD_STRUCTS_HPP
8
#define DUNEDAQ_CMDLIB_CMD_STRUCTS_HPP
9
10
#include <cstdint>
11
12
#include <nlohmann/json.hpp>
13
#include <string>
14
15
namespace
dunedaq::cmdlib::cmd
{
16
17
// @brief The aplication name.
18
using
AppId
= std::string;
19
20
// @brief The command name. FIXME: this should be an enum!
21
using
CmdId
= std::string;
22
23
// @brief An opaque object holding lower layer substructure
24
using
Data
= nlohmann::json;
25
26
// @brief Top-level command object structure
27
struct
Command
28
{
29
30
// @brief Identify the type of command
31
CmdId
id
=
""
;
32
33
// @brief Command data object with type-specific structure
34
Data
data
= {};
35
};
36
37
// @brief Outcome of the command: OK=true, NotOK=false
38
using
IsOk
=
bool
;
39
40
// @brief The command name.
41
using
Result
= std::string;
42
43
// @brief Top-level command reply object structure
44
struct
CommandReply
45
{
46
47
// @brief Outcome of the command: OK=true, NotOK=false
48
IsOk
success
=
true
;
49
50
// @brief Textual result of the command
51
Result
result
=
""
;
52
53
// @brief Application name
54
AppId
appname
=
""
;
55
56
// @brief Command reply data object with type-specific structure
57
Data
data
= {};
58
};
59
60
}
// namespace dunedaq::cmdlib::cmd
61
62
#endif
// DUNEDAQ_CMDLIB_CMD_STRUCTS_HPP
dunedaq::cmdlib::cmd
Definition
Nljs.hpp:16
dunedaq::cmdlib::cmd::AppId
std::string AppId
Definition
Structs.hpp:18
dunedaq::cmdlib::cmd::Data
nlohmann::json Data
Definition
Structs.hpp:24
dunedaq::cmdlib::cmd::Result
std::string Result
Definition
Structs.hpp:41
dunedaq::cmdlib::cmd::CmdId
std::string CmdId
Definition
Structs.hpp:21
dunedaq::cmdlib::cmd::IsOk
bool IsOk
Definition
Structs.hpp:38
dunedaq::bool
Unknown serialization type<< t,((char) t)) template< typename T > inline std::string datatype_to_string() { return "Unknown";} namespace serialization { template< typename T > struct is_serializable :std::false_type {};enum SerializationType { kMsgPack };inline SerializationType from_string(const std::string s) { if(s=="msgpack") return kMsgPack;throw UnknownSerializationTypeString(ERS_HERE, s);} constexpr uint8_t serialization_type_byte(SerializationType stype) { switch(stype) { case kMsgPack:return 'M';default:throw UnknownSerializationTypeEnum(ERS_HERE);} } constexpr SerializationType DEFAULT_SERIALIZATION_TYPE=kMsgPack;template< class T > std::vector< uint8_t > serialize(const T &obj, SerializationType stype=DEFAULT_SERIALIZATION_TYPE) { switch(stype) { case kMsgPack:{ msgpack::sbuffer buf;msgpack::pack(buf, obj);std::vector< uint8_t > ret(buf.size()+1);ret[0]=serialization_type_byte(stype);std::copy(buf.data(), buf.data()+buf.size(), ret.begin()+1);return ret;} default:throw UnknownSerializationTypeEnum(ERS_HERE);} } template< class T, typename CharType=unsigned char > T deserialize(const std::vector< CharType > &v) { switch(v[0]) { case serialization_type_byte(kMsgPack):{ try { msgpack::object_handle oh=msgpack::unpack(const_cast< char * >(reinterpret_cast< const char * >(v.data()+1)), v.size() - 1,[](msgpack::type::object_type, std::size_t, void *) -> bool
Definition
Serialization.hpp:256
dunedaq::cmdlib::cmd::CommandReply
Definition
Structs.hpp:45
dunedaq::cmdlib::cmd::CommandReply::result
Result result
Definition
Structs.hpp:51
dunedaq::cmdlib::cmd::CommandReply::appname
AppId appname
Definition
Structs.hpp:54
dunedaq::cmdlib::cmd::CommandReply::data
Data data
Definition
Structs.hpp:57
dunedaq::cmdlib::cmd::CommandReply::success
IsOk success
Definition
Structs.hpp:48
dunedaq::cmdlib::cmd::Command
Definition
Structs.hpp:28
dunedaq::cmdlib::cmd::Command::data
Data data
Definition
Structs.hpp:34
Generated on
for DUNE-DAQ by
1.17.0