Commit d89ecb91 authored by Stanislav Bohm's avatar Stanislav Bohm

ENH: Datatype "Array"

parent 95315818
......@@ -66,8 +66,12 @@ class Client(object):
def _receive_data(self):
msg_data = Data()
msg_data.ParseFromString(self.connection.receive_message())
assert msg_data.type_id == 300
return self.connection.read_data(msg_data.size)
type_id = msg_data.type_id
if type_id == 300: # Data
return self.connection.read_data(msg_data.arg0_u64)
if type_id == 400: # Array
return [self._receive_data() for i in xrange(msg_data.arg0_u64)]
assert 0
def _send_message(self, message):
data = message.SerializeToString()
......
......@@ -18,7 +18,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='loomcomm.proto',
package='loomcomm',
serialized_pb=_b('\n\x0eloomcomm.proto\x12\x08loomcomm\"\xbb\x01\n\x08Register\x12\x18\n\x10protocol_version\x18\x01 \x02(\x05\x12%\n\x04type\x18\x02 \x02(\x0e\x32\x17.loomcomm.Register.Type\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x12\n\ntask_types\x18\x04 \x03(\t\x12\x0c\n\x04\x63pus\x18\x05 \x01(\x05\x12\x0c\n\x04info\x18\n \x01(\x08\"0\n\x04Type\x12\x13\n\x0fREGISTER_WORKER\x10\x01\x12\x13\n\x0fREGISTER_CLIENT\x10\x02\"&\n\rServerMessage\"\x15\n\x04Type\x12\r\n\tSTART_JOB\x10\x01\"\xc4\x01\n\rWorkerCommand\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.WorkerCommand.Type\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x11\n\ttask_type\x18\x03 \x01(\x05\x12\x13\n\x0btask_config\x18\x04 \x01(\t\x12\x13\n\x0btask_inputs\x18\x05 \x03(\x05\x12\x0f\n\x07\x61\x64\x64ress\x18\n \x01(\t\x12\x11\n\twith_size\x18\x0b \x01(\x08\"\x1a\n\x04Type\x12\x08\n\x04TASK\x10\x01\x12\x08\n\x04SEND\x10\x02\"\x1c\n\x0eWorkerResponse\x12\n\n\x02id\x18\x02 \x01(\x05\"\x18\n\x08\x41nnounce\x12\x0c\n\x04port\x18\x01 \x02(\x05\"-\n\x0c\x44\x61taPrologue\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x11\n\tdata_size\x18\x03 \x01(\x04\"%\n\x04\x44\x61ta\x12\x0f\n\x07type_id\x18\x01 \x02(\x05\x12\x0c\n\x04size\x18\x02 \x01(\x04\"\"\n\x04Info\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0e\n\x06worker\x18\x02 \x02(\t\"\x9b\x01\n\rClientMessage\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.ClientMessage.Type\x12$\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x16.loomcomm.DataPrologue\x12\x1c\n\x04info\x18\x03 \x01(\x0b\x32\x0e.loomcomm.Info\"\x1a\n\x04Type\x12\x08\n\x04\x44\x41TA\x10\x01\x12\x08\n\x04INFO\x10\x02\x42\x02H\x03')
serialized_pb=_b('\n\x0eloomcomm.proto\x12\x08loomcomm\"\xbb\x01\n\x08Register\x12\x18\n\x10protocol_version\x18\x01 \x02(\x05\x12%\n\x04type\x18\x02 \x02(\x0e\x32\x17.loomcomm.Register.Type\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x12\n\ntask_types\x18\x04 \x03(\t\x12\x0c\n\x04\x63pus\x18\x05 \x01(\x05\x12\x0c\n\x04info\x18\n \x01(\x08\"0\n\x04Type\x12\x13\n\x0fREGISTER_WORKER\x10\x01\x12\x13\n\x0fREGISTER_CLIENT\x10\x02\"&\n\rServerMessage\"\x15\n\x04Type\x12\r\n\tSTART_JOB\x10\x01\"\xc4\x01\n\rWorkerCommand\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.WorkerCommand.Type\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x11\n\ttask_type\x18\x03 \x01(\x05\x12\x13\n\x0btask_config\x18\x04 \x01(\t\x12\x13\n\x0btask_inputs\x18\x05 \x03(\x05\x12\x0f\n\x07\x61\x64\x64ress\x18\n \x01(\t\x12\x11\n\twith_size\x18\x0b \x01(\x08\"\x1a\n\x04Type\x12\x08\n\x04TASK\x10\x01\x12\x08\n\x04SEND\x10\x02\"\x1c\n\x0eWorkerResponse\x12\n\n\x02id\x18\x02 \x01(\x05\"\x18\n\x08\x41nnounce\x12\x0c\n\x04port\x18\x01 \x02(\x05\"-\n\x0c\x44\x61taPrologue\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x11\n\tdata_size\x18\x03 \x01(\x04\";\n\x04\x44\x61ta\x12\x0f\n\x07type_id\x18\x01 \x02(\x05\x12\x10\n\x08\x61rg0_u64\x18\x02 \x01(\x04\x12\x10\n\x08\x61rg1_u64\x18\x03 \x01(\x04\"\"\n\x04Info\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0e\n\x06worker\x18\x02 \x02(\t\"\x9b\x01\n\rClientMessage\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.ClientMessage.Type\x12$\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x16.loomcomm.DataPrologue\x12\x1c\n\x04info\x18\x03 \x01(\x0b\x32\x0e.loomcomm.Info\"\x1a\n\x04Type\x12\x08\n\x04\x44\x41TA\x10\x01\x12\x08\n\x04INFO\x10\x02\x42\x02H\x03')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
......@@ -103,8 +103,8 @@ _CLIENTMESSAGE_TYPE = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=765,
serialized_end=791,
serialized_start=787,
serialized_end=813,
)
_sym_db.RegisterEnumDescriptor(_CLIENTMESSAGE_TYPE)
......@@ -384,12 +384,19 @@ _DATA = _descriptor.Descriptor(
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='size', full_name='loomcomm.Data.size', index=1,
name='arg0_u64', full_name='loomcomm.Data.arg0_u64', index=1,
number=2, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='arg1_u64', full_name='loomcomm.Data.arg1_u64', index=2,
number=3, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
......@@ -402,7 +409,7 @@ _DATA = _descriptor.Descriptor(
oneofs=[
],
serialized_start=560,
serialized_end=597,
serialized_end=619,
)
......@@ -438,8 +445,8 @@ _INFO = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=599,
serialized_end=633,
serialized_start=621,
serialized_end=655,
)
......@@ -483,8 +490,8 @@ _CLIENTMESSAGE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=636,
serialized_end=791,
serialized_start=658,
serialized_end=813,
)
_REGISTER.fields_by_name['type'].enum_type = _REGISTER_TYPE
......
......@@ -53,7 +53,7 @@ class OpenTask(Task):
class SplitLinesTask(Task):
task_type = "split_lines"
struct = u32 = struct.Struct("<QQ")
struct = struct.Struct("<QQ")
def __init__(self, input, start, end):
self.config = self.struct.pack(start, end)
......@@ -137,6 +137,10 @@ class RunTask(Task):
class Plan(object):
TASK_ARRAY_MAKE = "array/make"
TASK_ARRAY_GET = "array/get"
u64 = struct.Struct("<Q")
def __init__(self):
self.tasks = []
self.task_types = set()
......@@ -164,6 +168,19 @@ class Plan(object):
return self.add(
RunTask(args, stdin=stdin, stdout=stdout, variable=variable))
def task_array_make(self, inputs):
task = Task()
task.task_type = self.TASK_ARRAY_MAKE
task.inputs = inputs
return self.add(task)
def task_array_get(self, input, index):
task = Task()
task.task_type = self.TASK_ARRAY_GET
task.inputs = (input,)
task.config = self.u64.pack(index)
return self.add(task)
def create_message(self):
task_types = list(self.task_types)
task_types.sort()
......
......@@ -4,6 +4,8 @@ add_library(libloom
data/externfile.h
data/rawdata.h
data/rawdata.cpp
data/array.h
data/array.cpp
connection.cpp
connection.h
worker.cpp
......
......@@ -22,8 +22,6 @@ Connection::~Connection()
assert(state == ConnectionClosed);
}
std::string Connection::get_peername()
{
sockaddr_in addr;
......
......@@ -12,16 +12,16 @@ void Data::serialize(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &
{
loomcomm::Data msg;
msg.set_type_id(get_type_id());
msg.set_size(get_size());
//init_message(worker, msg);
//msg.set_size(get_size());
init_message(worker, msg);
buffer.add(msg);
serialize_data(worker, buffer, data_ptr);
}
/*void init_message(Worker &worker, loomcomm::Data &msg)
void Data::init_message(Worker &worker, loomcomm::Data &msg) const
{
}*/
}
char *Data::get_raw_data(Worker &worker)
{
......@@ -30,7 +30,7 @@ char *Data::get_raw_data(Worker &worker)
std::string Data::get_filename(Worker &worker) const
{
return "";
return "";
}
DataUnpacker::~DataUnpacker()
......
......@@ -26,11 +26,12 @@ public:
virtual std::string get_info() = 0;
void serialize(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &data_ptr);
//virtual void init_message(Worker &worker, loomcomm::Data &msg);
virtual void init_message(Worker &worker, loomcomm::Data &msg) const;
virtual void serialize_data(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &data_ptr) = 0;
virtual char *get_raw_data(Worker &worker);
virtual std::string get_filename(Worker &worker) const;
};
class DataUnpacker
......@@ -42,12 +43,12 @@ public:
virtual void on_data_chunk(const char *data, size_t size);
virtual bool on_data_finish(Connection &connection);
std::unique_ptr<Data> release_data() {
return std::move(data);
std::shared_ptr<Data>& get_data() {
return data;
}
protected:
std::unique_ptr<Data> data;
std::shared_ptr<Data> data;
};
}
......
#include "array.h"
#include "../compat.h"
#include "../worker.h"
loom::Array::Array(size_t length, std::unique_ptr<std::shared_ptr<Data>[]> items)
: length(length), items(std::move(items))
{
}
loom::Array::~Array()
{
}
size_t loom::Array::get_size()
{
size_t size = 0;
for (size_t i = 0; i < length; i++) {
size += items[i]->get_size();
}
return size;
}
std::string loom::Array::get_info()
{
return "Array";
}
std::shared_ptr<loom::Data>& loom::Array::get_at_index(size_t index)
{
assert(index < length);
return items[index];
}
void loom::Array::serialize_data(loom::Worker &worker, loom::SendBuffer &buffer, std::shared_ptr<loom::Data> &data_ptr)
{
for (size_t i = 0; i < length; i++) {
items[i]->serialize(worker, buffer, items[i]);
}
}
void loom::Array::init_message(loom::Worker &worker, loomcomm::Data &msg) const
{
msg.set_arg0_u64(length);
}
loom::ArrayUnpacker::~ArrayUnpacker()
{
}
bool loom::ArrayUnpacker::init(loom::Worker &worker, loom::Connection &connection, const loomcomm::Data &msg)
{
assert(msg.has_arg0_u64());
index = 0;
length = msg.arg0_u64();
items = std::make_unique<std::shared_ptr<Data>[]>(length);
if (length == 0) {
finish();
return true;
} else {
this->worker = &worker;
return false;
}
}
bool loom::ArrayUnpacker::on_message(loom::Connection &connection, const char *data, size_t size)
{
if (unpacker) {
bool r = unpacker->on_message(connection, data, size);
if (r) {
return finish_data();
}
return false;
}
loomcomm::Data msg;
msg.ParseFromArray(data, size);
unpacker = worker->unpack(msg.type_id());
if (unpacker->init(*worker, connection, msg)) {
return finish_data();
} else {
return false;
}
}
void loom::ArrayUnpacker::on_data_chunk(const char *data, size_t size)
{
unpacker->on_data_chunk(data, size);;
}
bool loom::ArrayUnpacker::on_data_finish(loom::Connection &connection)
{
bool r = unpacker->on_data_finish(connection);
if (r) {
return finish_data();
}
return false;
}
void loom::ArrayUnpacker::finish()
{
data = std::make_shared<Array>(length, std::move(items));
}
bool loom::ArrayUnpacker::finish_data()
{
items[index] = unpacker->get_data();
unpacker.reset();
index++;
if (index == length) {
finish();
return true;
} else {
return false;
}
}
#ifndef LIBLOOM_DATA_ARRAY_H
#define LIBLOOM_DATA_ARRAY_H
#include "../data.h"
namespace loom {
class Array : public Data {
public:
static const int TYPE_ID = 400;
Array(size_t length, std::unique_ptr<std::shared_ptr<Data>[]> items);
~Array();
int get_type_id() {
return TYPE_ID;
}
size_t get_length() const {
return length;
}
size_t get_size();
std::string get_info();
std::shared_ptr<Data>& get_at_index(size_t index);
void serialize_data(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &data_ptr);
void init_message(Worker &worker, loomcomm::Data &msg) const;
private:
size_t length;
std::unique_ptr<std::shared_ptr<Data>[]> items;
};
class ArrayUnpacker : public DataUnpacker
{
public:
~ArrayUnpacker();
bool init(Worker &worker, Connection &connection, const loomcomm::Data &msg);
bool on_message(Connection &connection, const char *data, size_t size);
void on_data_chunk(const char *data, size_t size);
bool on_data_finish(Connection &connection);
protected:
void finish();
bool finish_data();
std::unique_ptr<DataUnpacker> unpacker;
Worker *worker;
size_t index;
size_t length;
std::unique_ptr<std::shared_ptr<Data>[]> items;
};
}
#endif // LIBLOOM_DATA_ARRAY_H
......@@ -61,16 +61,15 @@ char* RawData::init_empty_file(Worker &worker, size_t size)
}
if (size > 0) {
if (!lseek(fd, size - 1, SEEK_SET)) {
if (lseek(fd, size - 1, SEEK_SET) == -1) {
log_errno_abort("lseek");
}
if (write(fd, "", 1) != 1) {
log_errno_abort("write");
}
map(fd, true);
}
map(fd, true);
::close(fd);
return data;
}
......@@ -99,8 +98,11 @@ std::string RawData::get_filename(Worker &worker) const
void RawData::open(Worker &worker)
{
assert(file_id);
if (size == 0) {
return;
}
assert(file_id);
int fd = ::open(get_filename(worker).c_str(), O_RDONLY, S_IRUSR | S_IWUSR);
if (fd < 0) {
llog->critical("Cannot open data {}", get_filename(worker));
......@@ -130,13 +132,13 @@ void RawData::map(int fd, bool write)
std::string RawData::get_info()
{
return "RawData";
return "RawData";
}
/*void RawData::init_message(Worker &worker, loomcomm::Data &msg)
void RawData::init_message(Worker &worker, loomcomm::Data &msg) const
{
}*/
msg.set_arg0_u64(size);
}
void RawData::serialize_data(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &data_ptr)
{
......@@ -150,11 +152,11 @@ RawDataUnpacker::~RawDataUnpacker()
bool RawDataUnpacker::init(Worker &worker, Connection &connection, const loomcomm::Data &msg)
{
auto data = std::make_unique<RawData>();
assert(msg.has_size());
auto size = msg.size();
pointer = data->init_empty_file(worker, size);
this->data = std::move(data);
this->data = std::make_shared<RawData>();
RawData &data = static_cast<RawData&>(*this->data);
assert(msg.has_arg0_u64());
auto size = msg.arg0_u64();
pointer = data.init_empty_file(worker, size);
if (size == 0) {
return true;
}
......
......@@ -29,6 +29,7 @@ public:
}
std::string get_info();
void init_message(Worker &worker, loomcomm::Data &msg) const;
void serialize_data(Worker &worker, SendBuffer &buffer, std::shared_ptr<Data> &data_ptr);
char* init_memonly(size_t size);
......
......@@ -44,7 +44,7 @@ void InterConnection::finish_data()
{
llog->debug("Data {} sucessfully received", data_id);
worker.publish_data(data_id,
data_unpacker->release_data());
data_unpacker->get_data());
data_unpacker.reset();
data_id = -1;
}
......
......@@ -1709,7 +1709,8 @@ void DataPrologue::Swap(DataPrologue* other) {
#ifndef _MSC_VER
const int Data::kTypeIdFieldNumber;
const int Data::kSizeFieldNumber;
const int Data::kArg0U64FieldNumber;
const int Data::kArg1U64FieldNumber;
#endif // !_MSC_VER
Data::Data()
......@@ -1731,7 +1732,8 @@ Data::Data(const Data& from)
void Data::SharedCtor() {
_cached_size_ = 0;
type_id_ = 0;
size_ = GOOGLE_ULONGLONG(0);
arg0_u64_ = GOOGLE_ULONGLONG(0);
arg1_u64_ = GOOGLE_ULONGLONG(0);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
......@@ -1780,7 +1782,7 @@ void Data::Clear() {
::memset(&first, 0, n); \
} while (0)
ZR_(size_, type_id_);
ZR_(arg0_u64_, type_id_);
#undef OFFSET_OF_FIELD_
#undef ZR_
......@@ -1813,18 +1815,33 @@ bool Data::MergePartialFromCodedStream(
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_size;
if (input->ExpectTag(16)) goto parse_arg0_u64;
break;
}
// optional uint64 size = 2;
// optional uint64 arg0_u64 = 2;
case 2: {
if (tag == 16) {
parse_size:
parse_arg0_u64:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &size_)));
set_has_size();
input, &arg0_u64_)));
set_has_arg0_u64();
} else {
goto handle_unusual;
}
if (input->ExpectTag(24)) goto parse_arg1_u64;
break;
}
// optional uint64 arg1_u64 = 3;
case 3: {
if (tag == 24) {
parse_arg1_u64:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
input, &arg1_u64_)));
set_has_arg1_u64();
} else {
goto handle_unusual;
}
......@@ -1862,9 +1879,14 @@ void Data::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->type_id(), output);
}
// optional uint64 size = 2;
if (has_size()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->size(), output);
// optional uint64 arg0_u64 = 2;
if (has_arg0_u64()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->arg0_u64(), output);
}
// optional uint64 arg1_u64 = 3;
if (has_arg1_u64()) {
::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->arg1_u64(), output);
}
output->WriteRaw(unknown_fields().data(),
......@@ -1883,11 +1905,18 @@ int Data::ByteSize() const {
this->type_id());
}
// optional uint64 size = 2;
if (has_size()) {
// optional uint64 arg0_u64 = 2;
if (has_arg0_u64()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->arg0_u64());
}
// optional uint64 arg1_u64 = 3;
if (has_arg1_u64()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt64Size(
this->size());
this->arg1_u64());
}
}
......@@ -1910,8 +1939,11 @@ void Data::MergeFrom(const Data& from) {
if (from.has_type_id()) {
set_type_id(from.type_id());
}
if (from.has_size()) {
set_size(from.size());
if (from.has_arg0_u64()) {
set_arg0_u64(from.arg0_u64());
}
if (from.has_arg1_u64()) {
set_arg1_u64(from.arg1_u64());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
......@@ -1932,7 +1964,8 @@ bool Data::IsInitialized() const {
void Data::Swap(Data* other) {
if (other != this) {
std::swap(type_id_, other->type_id_);
std::swap(size_, other->size_);
std::swap(arg0_u64_, other->arg0_u64_);
std::swap(arg1_u64_, other->arg1_u64_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
......
......@@ -861,25 +861,35 @@ class Data : public ::google::protobuf::MessageLite {
inline ::google::protobuf::int32 type_id() const;
inline void set_type_id(::google::protobuf::int32 value);
// optional uint64 size = 2;
inline bool has_size() const;
inline void clear_size();
static const int kSizeFieldNumber = 2;
inline ::google::protobuf::uint64 size() const;
inline void set_size(::google::protobuf::uint64 value);
// optional uint64 arg0_u64 = 2;
inline bool has_arg0_u64() const;
inline void clear_arg0_u64();
static const int kArg0U64FieldNumber = 2;
inline ::google::protobuf::uint64 arg0_u64() const;
inline void set_arg0_u64(::google::protobuf::uint64 value);
// optional uint64 arg1_u64 = 3;
inline bool has_arg1_u64() const;
inline void clear_arg1_u64();
static const int kArg1U64FieldNumber = 3;
inline ::google::protobuf::uint64 arg1_u64() const;
inline void set_arg1_u64(::google::protobuf::uint64 value);
// @@protoc_insertion_point(class_scope:loomcomm.Data)
private:
inline void set_has_type_id();
inline void clear_has_type_id();
inline void set_has_size();
inline void clear_has_size();
inline void set_has_arg0_u64();
inline void clear_has_arg0_u64();
inline void set_has_arg1_u64();
inline void clear_has_arg1_u64();
::std::string _unknown_fields_;
::google::protobuf::uint32 _has_bits_[1];
mutable int _cached_size_;
::google::protobuf::uint64 size_;
::google::protobuf::uint64 arg0_u64_;
::google::protobuf::uint64 arg1_u64_;
::google::protobuf::int32 type_id_;
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
friend void protobuf_AddDesc_loomcomm_2eproto_impl();
......@@ -1731,28 +1741,52 @@ inline void Data::set_type_id(::google::protobuf::int32 value) {
// @@protoc_insertion_point(field_set:loomcomm.Data.type_id)
}
// optional uint64 size = 2;
inline bool Data::has_size() const {
// optional uint64 arg0_u64 = 2;
inline bool Data::has_arg0_u64() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Data::set_has_size() {
inline void Data::set_has_arg0_u64() {
_has_bits_[0] |= 0x00000002u;
}
inline void Data::clear_has_size() {
inline void Data::clear_has_arg0_u64() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Data::clear_size() {
size_ = GOOGLE_ULONGLONG(0);
clear_has_size();
inline void Data::clear_arg0_u64() {
arg0_u64_ = GOOGLE_ULONGLONG(0);
clear_has_arg0_u64();
}
inline ::google::protobuf::uint64 Data::size() const {
// @@protoc_insertion_point(field_get:loomcomm.Data.size)
return size_;
inline ::google::protobuf::uint64 Data::arg0_u64() const {
// @@protoc_insertion_point(field_get:loomcomm.Data.arg0_u64)
return arg0_u64_;
}
inline void Data::set_size(::google::protobuf::uint64 value) {
set_has_size();
size_ = value;
// @@protoc_insertion_point(field_set:loomcomm.Data.size)
inline void Data::set_arg0_u64(::google::protobuf::uint64 value) {
set_has_arg0_u64();
arg0_u64_ = value;
// @@protoc_insertion_point(field_set:loomcomm.Data.arg0_u64)
}
// optional uint64 arg1_u64 = 3;
inline bool Data::has_arg1_u64() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Data::set_has_arg1_u64() {
_has_bits_[0] |= 0x00000004u;
}
inline void Data::clear_has_arg1_u64() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Data::clear_arg1_u64() {
arg1_u64_ = GOOGLE_ULONGLONG(0);
clear_has_arg1_u64();
}
inline ::google::protobuf::uint64 Data::arg1_u64() const {
// @@protoc_insertion_point(field_get:loomcomm.Data.arg1_u64)
return arg1_u64_;
}
inline void Data::set_arg1_u64(::google::protobuf::uint64 value) {
set_has_arg1_u64();
arg1_u64_ = value;
// @@protoc_insertion_point(field_set:loomcomm.Data.arg1_u64)
}