mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
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
This commit is contained in:
committed by
Robert Nishihara
parent
65a8659f3d
commit
0b8d279ef2
@@ -0,0 +1,41 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user