Commit 378c8a0d authored by David COME's avatar David COME
Browse files

Sources from proto files are now generated on the fly by cmake

parent 6946d2bd
find_package(Protobuf)
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
add_library(castormessages SHARED
Exception.pb.cc
ForkCleaner.pb.cc
ForkDataTransfer.pb.cc
ForkLabel.pb.cc
ForkSucceeded.pb.cc
${ProtoSources}
Frame.cpp
Header.pb.cc
Heartbeat.pb.cc
messages.cpp
MigrationJobFromTapeGateway.pb.cc
MigrationJobFromWriteTp.pb.cc
NbFilesOnTape.pb.cc
ProcessCrashed.pb.cc
ProcessExited.pb.cc
RecallJobFromReadTp.pb.cc
RecallJobFromTapeGateway.pb.cc
ReturnValue.pb.cc
SmartZmqContext.cpp
StopProcessForker.pb.cc
TapeMountedForMigration.pb.cc
TapeMountedForRecall.pb.cc
TapeserverProxy.cpp
TapeserverProxyDummy.cpp
TapeserverProxyDummyFactory.cpp
TapeserverProxyFactory.cpp
TapeserverProxyZmq.cpp
TapeserverProxyZmqFactory.cpp
TapeUnmountStarted.pb.cc
TapeUnmounted.pb.cc
ZmqMsg.cpp
ZmqSocket.cpp
ZmqSocketMT.cpp
......
// Generated by the protocol buffer compiler. DO NOT EDIT!
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "Exception.pb.h"
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace castor {
namespace messages {
namespace {
const ::google::protobuf::Descriptor* Exception_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Exception_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_Exception_2eproto() {
protobuf_AddDesc_Exception_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Exception.proto");
GOOGLE_CHECK(file != NULL);
Exception_descriptor_ = file->message_type(0);
static const int Exception_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, code_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, message_),
};
Exception_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Exception_descriptor_,
Exception::default_instance_,
Exception_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Exception));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_Exception_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Exception_descriptor_, &Exception::default_instance());
}
} // namespace
void protobuf_ShutdownFile_Exception_2eproto() {
delete Exception::default_instance_;
delete Exception_reflection_;
}
void protobuf_AddDesc_Exception_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\017Exception.proto\022\017castor.messages\"*\n\tEx"
"ception\022\014\n\004code\030\001 \002(\r\022\017\n\007message\030\002 \002(\t", 78);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"Exception.proto", &protobuf_RegisterTypes);
Exception::default_instance_ = new Exception();
Exception::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Exception_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_Exception_2eproto {
StaticDescriptorInitializer_Exception_2eproto() {
protobuf_AddDesc_Exception_2eproto();
}
} static_descriptor_initializer_Exception_2eproto_;
// ===================================================================
const ::std::string Exception::_default_message_;
#ifndef _MSC_VER
const int Exception::kCodeFieldNumber;
const int Exception::kMessageFieldNumber;
#endif // !_MSC_VER
Exception::Exception()
: ::google::protobuf::Message() {
SharedCtor();
}
void Exception::InitAsDefaultInstance() {
}
Exception::Exception(const Exception& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void Exception::SharedCtor() {
_cached_size_ = 0;
code_ = 0u;
message_ = const_cast< ::std::string*>(&_default_message_);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Exception::~Exception() {
SharedDtor();
}
void Exception::SharedDtor() {
if (message_ != &_default_message_) {
delete message_;
}
if (this != default_instance_) {
}
}
void Exception::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Exception::descriptor() {
protobuf_AssignDescriptorsOnce();
return Exception_descriptor_;
}
const Exception& Exception::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Exception_2eproto(); return *default_instance_;
}
Exception* Exception::default_instance_ = NULL;
Exception* Exception::New() const {
return new Exception;
}
void Exception::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
code_ = 0u;
if (_has_bit(1)) {
if (message_ != &_default_message_) {
message_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Exception::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 code = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &code_)));
_set_bit(0);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_message;
break;
}
// required string message = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_message:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_message()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void Exception::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 code = 1;
if (_has_bit(0)) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->code(), output);
}
// required string message = 2;
if (_has_bit(1)) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->message(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* Exception::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required uint32 code = 1;
if (_has_bit(0)) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->code(), target);
}
// required string message = 2;
if (_has_bit(1)) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->message(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int Exception::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required uint32 code = 1;
if (has_code()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->code());
}
// required string message = 2;
if (has_message()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->message());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Exception::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Exception* source =
::google::protobuf::internal::dynamic_cast_if_available<const Exception*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Exception::MergeFrom(const Exception& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from._has_bit(0)) {
set_code(from.code());
}
if (from._has_bit(1)) {
set_message(from.message());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Exception::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Exception::CopyFrom(const Exception& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Exception::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void Exception::Swap(Exception* other) {
if (other != this) {
std::swap(code_, other->code_);
std::swap(message_, other->message_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata Exception::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Exception_descriptor_;
metadata.reflection = Exception_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace messages
} // namespace castor
// @@protoc_insertion_point(global_scope)
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Exception.proto
#ifndef PROTOBUF_Exception_2eproto__INCLUDED
#define PROTOBUF_Exception_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2003000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_message_reflection.h>
// @@protoc_insertion_point(includes)
namespace castor {
namespace messages {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_Exception_2eproto();
void protobuf_AssignDesc_Exception_2eproto();
void protobuf_ShutdownFile_Exception_2eproto();
class Exception;
// ===================================================================
class Exception : public ::google::protobuf::Message {
public:
Exception();
virtual ~Exception();
Exception(const Exception& from);
inline Exception& operator=(const Exception& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Exception& default_instance();
void Swap(Exception* other);
// implements Message ----------------------------------------------
Exception* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Exception& from);
void MergeFrom(const Exception& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required uint32 code = 1;
inline bool has_code() const;
inline void clear_code();
static const int kCodeFieldNumber = 1;
inline ::google::protobuf::uint32 code() const;
inline void set_code(::google::protobuf::uint32 value);
// required string message = 2;
inline bool has_message() const;
inline void clear_message();
static const int kMessageFieldNumber = 2;
inline const ::std::string& message() const;
inline void set_message(const ::std::string& value);
inline void set_message(const char* value);
inline void set_message(const char* value, size_t size);
inline ::std::string* mutable_message();
// @@protoc_insertion_point(class_scope:castor.messages.Exception)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 code_;
::std::string* message_;
static const ::std::string _default_message_;
friend void protobuf_AddDesc_Exception_2eproto();
friend void protobuf_AssignDesc_Exception_2eproto();
friend void protobuf_ShutdownFile_Exception_2eproto();
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
// WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
inline bool _has_bit(int index) const {
return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
}
inline void _set_bit(int index) {
_has_bits_[index / 32] |= (1u << (index % 32));
}
inline void _clear_bit(int index) {
_has_bits_[index / 32] &= ~(1u << (index % 32));
}
void InitAsDefaultInstance();
static Exception* default_instance_;
};
// ===================================================================
// ===================================================================
// Exception
// required uint32 code = 1;
inline bool Exception::has_code() const {
return _has_bit(0);
}
inline void Exception::clear_code() {
code_ = 0u;
_clear_bit(0);
}
inline ::google::protobuf::uint32 Exception::code() const {
return code_;
}
inline void Exception::set_code(::google::protobuf::uint32 value) {
_set_bit(0);
code_ = value;
}
// required string message = 2;
inline bool Exception::has_message() const {
return _has_bit(1);
}
inline void Exception::clear_message() {
if (message_ != &_default_message_) {
message_->clear();
}
_clear_bit(1);
}
inline const ::std::string& Exception::message() const {
return *message_;
}
inline void Exception::set_message(const ::std::string& value) {
_set_bit(1);
if (message_ == &_default_message_) {
message_ = new ::std::string;
}
message_->assign(value);
}
inline void Exception::set_message(const char* value) {
_set_bit(1);
if (message_ == &_default_message_) {
message_ = new ::std::string;
}
message_->assign(value);
}
inline void Exception::set_message(const char* value, size_t size) {
_set_bit(1);
if (message_ == &_default_message_) {
message_ = new ::std::string;
}
message_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* Exception::mutable_message() {
_set_bit(1);
if (message_ == &_default_message_) {
message_ = new ::std::string;
}
return message_;