coral
A C++ library for distributed co-simulation
glue.hpp
Go to the documentation of this file.
1 
10 #ifndef CORAL_PROTOCOL_GLUE_HPP
11 #define CORAL_PROTOCOL_GLUE_HPP
12 
13 #include "coral/model.hpp"
14 #include "model.pb.h"
15 #include "net.pb.h"
16 
17 #include "coral/net.hpp"
18 #include "domain.pb.h"
19 
20 
21 namespace coral
22 {
23 namespace protocol
24 {
25 
26 
28 coralproto::model::VariableDescription ToProto(
29  const coral::model::VariableDescription& ourVariable);
30 
33  const coralproto::model::VariableDescription& protoVariable);
34 
36 coralproto::model::SlaveTypeDescription ToProto(
38 
41  const coralproto::model::SlaveTypeDescription& src);
42 
44 void ConvertToProto(
45  const coral::model::ScalarValue& source,
47 
50 
52 void ConvertToProto(
53  const coral::model::Variable& source,
54  coralproto::model::Variable& target);
55 
57 coral::model::Variable FromProto(const coralproto::model::Variable& source);
58 
59 void ConvertToProto(
60  const coral::net::SlaveLocator& source,
61  coralproto::net::SlaveLocator& target);
62 
63 coral::net::SlaveLocator FromProto(const coralproto::net::SlaveLocator& source);
64 
65 }} // namespace
66 #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
Main module header for coral::net.
boost::variant< double, int, bool, std::string > ScalarValue
An algebraic type that can hold values of all supported data types.
Definition: model.hpp:259
A description of a slave type.
Definition: model.hpp:148
Definition: variable_io.hpp:28
void ConvertToProto(const coral::model::ScalarValue &source, coralproto::model::ScalarValue &target)
Converts a ScalarValue to a protocol buffer (in place).
coralproto::model::VariableDescription ToProto(const coral::model::VariableDescription &ourVariable)
Converts a variable description to a protocol buffer.
A description of a single variable.
Definition: model.hpp:104
Class which represents the network location(s) of a slave.
Definition: net.hpp:292
Main module header for coral::model.
coral::model::VariableDescription FromProto(const coralproto::model::VariableDescription &protoVariable)
Converts a protocol buffer to a variable definition.