Files
ray/src/common/common_protocol.h
T
Philipp Moritz 0b8d279ef2 Convert task_spec to flatbuffers (#255)
* convert Ray to C++

* convert task_spec to flatbuffers

* fix

* it compiles

* latest

* tests are passing

* task2 -> task

* fix

* fix

* fix

* fix

* fix

* linting

* fix valgrind

* upgrade flatbuffers

* use debug mode for valgrind

* fix naming and comments

* downgrade flatbuffers

* fix linting

* reintroduce TaskSpec_free

* rename TaskSpec -> TaskInfo

* refactoring

* linting
2017-03-05 02:05:02 -08:00

42 lines
1.1 KiB
C

#ifndef COMMON_PROTOCOL_H
#define COMMON_PROTOCOL_H
#include "format/common_generated.h"
#include "common.h"
/**
* Convert an object ID to a flatbuffer string.
*
* @param fbb Reference to the flatbuffer builder.
* @param object_id The object ID to be converted.
* @return The flatbuffer string contining the object ID.
*/
flatbuffers::Offset<flatbuffers::String> to_flatbuf(
flatbuffers::FlatBufferBuilder &fbb,
ObjectID object_id);
/**
* Convert a flatbuffer string to an object ID.
*
* @param string The flatbuffer string.
* @return The object ID.
*/
ObjectID from_flatbuf(const flatbuffers::String *string);
/**
* Convert an array of object IDs to a flatbuffer vector of strings.
*
* @param fbb Reference to the flatbuffer builder.
* @param object_ids Array of object IDs.
* @param num_objects Number of elements in the array.
* @return Flatbuffer vector of strings.
*/
flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>>
to_flatbuf(flatbuffers::FlatBufferBuilder &fbb,
ObjectID object_ids[],
int64_t num_objects);
#endif