coral
A C++ library for distributed co-simulation
exe_data.hpp
Go to the documentation of this file.
1 
10 #ifndef CORAL_PROTOCOL_EXE_DATA_HPP
11 #define CORAL_PROTOCOL_EXE_DATA_HPP
12 
13 #include <vector>
14 #include "zmq.hpp"
15 #include "coral/model.hpp"
16 
17 
18 namespace coral
19 {
20 namespace protocol
21 {
22 
27 namespace exe_data
28 {
29 const size_t HEADER_SIZE = 6;
30 
31 struct Message
32 {
33  coral::model::Variable variable;
34  coral::model::StepID timestepID;
36 };
37 
38 Message ParseMessage(const std::vector<zmq::message_t>& rawMsg);
39 
40 void CreateMessage(const Message& message, std::vector<zmq::message_t>& rawOut);
41 
42 void Subscribe(zmq::socket_t& socket, const coral::model::Variable& variable);
43 
44 void Unsubscribe(zmq::socket_t& socket, const coral::model::Variable& variable);
45 
46 }}} // namespace
47 #endif // header guard
An object that identifies a variable in a simulation, and which consists of a slave ID and a variable...
Definition: model.hpp:270
boost::variant< double, int, bool, std::string > ScalarValue
An algebraic type that can hold values of all supported data types.
Definition: model.hpp:259
Definition: variable_io.hpp:28
Main module header for coral::model.