coral
A C++ library for distributed co-simulation
Classes | Namespaces | Functions
execution.hpp File Reference

Main header file for coral::protocol::execution. More...

#include <cstdint>
#include <vector>
#include "google/protobuf/message_lite.h"
#include "zmq.hpp"
#include "execution.pb.h"

Go to the source code of this file.

Classes

class  coral::protocol::execution::RemoteErrorException
 Exception which signifies that the remote end sent a DENIED or ERROR message. More...
 

Namespaces

 coral::protocol::execution
 Functions for constructing and parsing messages sent between execution participants.
 

Functions

void coral::protocol::execution::CreateHelloMessage (std::vector< zmq::message_t > &message, uint16_t protocolVersion)
 Fills message with a body-less HELLO message that requests the given protocol version. More...
 
void coral::protocol::execution::CreateHelloMessage (std::vector< zmq::message_t > &message, uint16_t protocolVersion, const google::protobuf::MessageLite &body)
 Fills message with a HELLO message that requests the given protocol version. More...
 
void coral::protocol::execution::CreateDeniedMessage (std::vector< zmq::message_t > &message, const std::string &reason=std::string())
 Fills 'message' with a DENIED message with the given reason string. More...
 
void coral::protocol::execution::CreateMessage (std::vector< zmq::message_t > &message, coralproto::execution::MessageType type)
 Fills message with a body-less message of the given type. More...
 
void coral::protocol::execution::CreateMessage (std::vector< zmq::message_t > &message, coralproto::execution::MessageType type, const google::protobuf::MessageLite &body)
 Fills message with a body-less message of the given type. More...
 
void coral::protocol::execution::CreateErrorMessage (std::vector< zmq::message_t > &message, coralproto::execution::ErrorInfo::Code code, const std::string &details=std::string())
 Fills message with an ERROR message. More...
 
void coral::protocol::execution::CreateFatalErrorMessage (std::vector< zmq::message_t > &message, coralproto::execution::ErrorInfo::Code code, const std::string &details=std::string())
 Fills message with a FATAL_ERROR message. More...
 
uint16_t coral::protocol::execution::ParseMessageType (const zmq::message_t &header)
 Parses the first two bytes of header as an uint16_t. More...
 
uint16_t coral::protocol::execution::NonErrorMessageType (const std::vector< zmq::message_t > &message)
 Parses the first two bytes of the message as an uint16_t, and throws an exception if it is an ERROR message. More...
 
uint16_t coral::protocol::execution::ParseHelloMessage (const std::vector< zmq::message_t > &message)
 Parses HELLO or DENIED messages. More...
 

Detailed Description

Main header file for coral::protocol::execution.