|
std::ostream & | operator<< (std::ostream &os, const ClassDefinition &definition) |
|
Definition at line 495 of file serialization.h.
◆ ClassDefinition()
hazelcast::client::serialization::ClassDefinition::ClassDefinition |
( |
int |
factory_id, |
|
|
int |
class_id, |
|
|
int |
version |
|
) |
| |
Constructor.
- Parameters
-
factoryId | factory id of class |
classId | id of class |
version | version of portable class |
Definition at line 315 of file serialization.cpp.
316 : factory_id_(factory_id), class_id_(class_id), version_(version), binary_(
new std::vector<byte>) {
◆ add_field_def()
void hazelcast::client::serialization::ClassDefinition::add_field_def |
( |
FieldDefinition & |
field_definition | ) |
|
Internal API.
- Parameters
-
fieldDefinition | to be added |
Definition at line 319 of file serialization.cpp.
320 field_definitions_map_[fd.get_name()] = fd;
◆ get_class_id()
int hazelcast::client::serialization::ClassDefinition::get_class_id |
( |
| ) |
const |
◆ get_factory_id()
int hazelcast::client::serialization::ClassDefinition::get_factory_id |
( |
| ) |
const |
◆ get_field()
const FieldDefinition & hazelcast::client::serialization::ClassDefinition::get_field |
( |
const std::string & |
field_name | ) |
const |
- Parameters
-
fieldName | name of the field |
- Returns
- field definition by given name
- Exceptions
-
illegal_argument | when field not found |
Definition at line 323 of file serialization.cpp.
324 auto it = field_definitions_map_.find(name);
325 if (it != field_definitions_map_.end()) {
328 BOOST_THROW_EXCEPTION(exception::hazelcast_serialization(
"ClassDefinition::getField",
329 (boost::format(
"Invalid field name: '%1%' for ClassDefinition {id: %2%, version: %3%}")
330 %name %class_id_ %version_).str()));
◆ get_field_count()
int hazelcast::client::serialization::ClassDefinition::get_field_count |
( |
| ) |
const |
- Returns
- total field count
Definition at line 342 of file serialization.cpp.
343 return (
int) field_definitions_map_.size();
◆ get_field_type()
field_type hazelcast::client::serialization::ClassDefinition::get_field_type |
( |
const std::string & |
field_name | ) |
const |
- Parameters
-
fieldName | name of the field |
- Returns
- type of given field
- Exceptions
-
illegal_argument_exception | |
Definition at line 337 of file serialization.cpp.
338 FieldDefinition
const &fd =
get_field(field_name);
339 return fd.get_type();
const FieldDefinition & get_field(const std::string &field_name) const
◆ get_version()
int hazelcast::client::serialization::ClassDefinition::get_version |
( |
| ) |
const |
◆ has_field()
bool hazelcast::client::serialization::ClassDefinition::has_field |
( |
const std::string & |
field_name | ) |
const |
- Parameters
-
- Returns
- true if this class definition contains a field named by given name
Definition at line 333 of file serialization.cpp.
334 return field_definitions_map_.find(field_name) != field_definitions_map_.end();
◆ read_data()
void hazelcast::client::serialization::ClassDefinition::read_data |
( |
object_data_input & |
data_input | ) |
|
Internal API.
- Parameters
-
Definition at line 375 of file serialization.cpp.
376 factory_id_ = data_input.read<int32_t>();
377 class_id_ = data_input.read<int32_t>();
378 version_ = data_input.read<int32_t>();
379 int size = data_input.read<int16_t>();
380 for (
int i = 0; i < size; i++) {
381 FieldDefinition fieldDefinition;
382 fieldDefinition.read_data(data_input);
void add_field_def(FieldDefinition &field_definition)
Internal API.
◆ set_version_if_not_set()
void hazelcast::client::serialization::ClassDefinition::set_version_if_not_set |
( |
int |
new_version | ) |
|
Internal API.
- Parameters
-
newVersion | portable version |
Definition at line 359 of file serialization.cpp.
361 this->version_ = new_version;
◆ write_data()
void hazelcast::client::serialization::ClassDefinition::write_data |
( |
pimpl::data_output & |
data_output | ) |
|
Internal API.
- Parameters
-
Definition at line 365 of file serialization.cpp.
366 data_output.write<int32_t>(factory_id_);
367 data_output.write<int32_t>(class_id_);
368 data_output.write<int32_t>(version_);
369 data_output.write<int16_t>(field_definitions_map_.size());
370 for (
auto &entry : field_definitions_map_) {
371 entry.second.write_data(data_output);
The documentation for this class was generated from the following files: