|
std::ostream & | operator<< (std::ostream &os, const ClassDefinition &definition) |
|
Definition at line 581 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 444 of file serialization.cpp.
445 : factory_id_(factory_id)
446 , class_id_(class_id)
448 , 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 452 of file serialization.cpp.
454 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 458 of file serialization.cpp.
460 auto it = field_definitions_map_.find(name);
461 if (it != field_definitions_map_.end()) {
464 BOOST_THROW_EXCEPTION(exception::hazelcast_serialization(
465 "ClassDefinition::getField",
466 (boost::format(
"Invalid field name: '%1%' for ClassDefinition {id: %2%, "
468 name % class_id_ % version_)
◆ get_field_count()
int hazelcast::client::serialization::ClassDefinition::get_field_count |
( |
| ) |
const |
- Returns
- total field count
Definition at line 487 of file serialization.cpp.
489 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 480 of file serialization.cpp.
482 FieldDefinition
const& fd =
get_field(field_name);
483 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 473 of file serialization.cpp.
475 return field_definitions_map_.find(field_name) !=
476 field_definitions_map_.end();
◆ read_data()
void hazelcast::client::serialization::ClassDefinition::read_data |
( |
object_data_input & |
data_input | ) |
|
Internal API.
- Parameters
-
Definition at line 531 of file serialization.cpp.
533 factory_id_ = data_input.read<int32_t>();
534 class_id_ = data_input.read<int32_t>();
535 version_ = data_input.read<int32_t>();
536 int size = data_input.read<int16_t>();
537 for (
int i = 0; i < size; i++) {
538 FieldDefinition fieldDefinition;
539 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 511 of file serialization.cpp.
514 this->version_ = new_version;
◆ write_data()
void hazelcast::client::serialization::ClassDefinition::write_data |
( |
pimpl::data_output & |
data_output | ) |
|
Internal API.
- Parameters
-
Definition at line 519 of file serialization.cpp.
521 data_output.write<int32_t>(factory_id_);
522 data_output.write<int32_t>(class_id_);
523 data_output.write<int32_t>(version_);
524 data_output.write<int16_t>(field_definitions_map_.size());
525 for (
auto& entry : field_definitions_map_) {
526 entry.second.write_data(data_output);
The documentation for this class was generated from the following files: