Fairport  v1.0.38
fairport::const_property_object Class Reference

Property object base class. More...

#include <object.h>

+ Inheritance diagram for fairport::const_property_object:

List of all members.

Public Member Functions

virtual ~const_property_object ()
virtual std::vector< prop_idget_prop_list () const =0
 Get a list of all properties on this object.
virtual prop_type get_prop_type (prop_id id) const =0
 Get the property type of a given prop_id.
virtual bool prop_exists (prop_id id) const =0
 Indicates the existance of a given property on this object.
virtual size_t size (prop_id id) const =0
 Returns the total size of a variable length property.
template<typename T >
read_prop (prop_id id) const
 Read a property as a given type.
template<typename T >
std::vector< T > read_prop_array (prop_id id) const
 Read a property as an array of the given type.
virtual hnid_stream_device open_prop_stream (prop_id id)=0
 Creates a stream device over a property on this object.

Protected Member Functions

virtual byte get_value_1 (prop_id id) const =0
 Implemented by child classes to fetch a 1 byte sized property.
virtual ushort get_value_2 (prop_id id) const =0
 Implemented by child classes to fetch a 2 byte sized property.
virtual ulong get_value_4 (prop_id id) const =0
 Implemented by child classes to fetch a 4 byte sized property.
virtual ulonglong get_value_8 (prop_id id) const =0
 Implemented by child classes to fetch a 8 byte sized property.
virtual std::vector< byteget_value_variable (prop_id id) const =0
 Implemented by child classes to fetch a variable sized property.

Detailed Description

Property object base class.

This class provides a simple interface (using templates) to access properties on an object. It defines a handful of virtual functions child classes implement to read the raw data.

This class is contains all the conversion logic between the different types, implemented as template specializations, and other property logic such as multivalued property parsing.

Definition at line 99 of file object.h.


Constructor & Destructor Documentation

virtual fairport::const_property_object::~const_property_object ( ) [inline, virtual]

Definition at line 102 of file object.h.


Member Function Documentation

virtual std::vector<prop_id> fairport::const_property_object::get_prop_list ( ) const [pure virtual]

Get a list of all properties on this object.

Returns:
A vector of all properties on this object

Implemented in fairport::const_table_row, and fairport::property_bag.

virtual prop_type fairport::const_property_object::get_prop_type ( prop_id  id) const [pure virtual]

Get the property type of a given prop_id.

Parameters:
[in]idThe prop_id
Exceptions:
key_not_found<prop_id>If the specified property is not present
Returns:
The type of the prop_id

Implemented in fairport::const_table_row, and fairport::property_bag.

virtual byte fairport::const_property_object::get_value_1 ( prop_id  id) const [protected, pure virtual]

Implemented by child classes to fetch a 1 byte sized property.

virtual ushort fairport::const_property_object::get_value_2 ( prop_id  id) const [protected, pure virtual]

Implemented by child classes to fetch a 2 byte sized property.

virtual ulong fairport::const_property_object::get_value_4 ( prop_id  id) const [protected, pure virtual]

Implemented by child classes to fetch a 4 byte sized property.

virtual ulonglong fairport::const_property_object::get_value_8 ( prop_id  id) const [protected, pure virtual]

Implemented by child classes to fetch a 8 byte sized property.

virtual std::vector<byte> fairport::const_property_object::get_value_variable ( prop_id  id) const [protected, pure virtual]

Implemented by child classes to fetch a variable sized property.

virtual hnid_stream_device fairport::const_property_object::open_prop_stream ( prop_id  id) [pure virtual]

Creates a stream device over a property on this object.

The returned stream device can be used to construct a proper stream:

 const_property_object* po = ...;
 prop_stream nstream(po->open_prop_stream(0x3001));

Which can then be used as any iostream would be.

Note:
This is operation is only valid for variable length properties
Parameters:
[in]idThe prop_id
Exceptions:
key_not_found<prop_id>If the specified property is not present
Returns:
A stream device for the requested property

Implemented in fairport::const_table_row, and fairport::property_bag.

virtual bool fairport::const_property_object::prop_exists ( prop_id  id) const [pure virtual]

Indicates the existance of a given property on this object.

Parameters:
[in]idThe prop_id
Returns:
true if the property exists

Implemented in fairport::const_table_row, and fairport::property_bag.

bool fairport::const_property_object::read_prop< bool > ( prop_id  id) const [inline]

Read a property as a given type.

It is the callers responsibility to ensure the prop_id is of or convertable to the requested type.

Template Parameters:
TThe type to interpret he property as
Parameters:
[in]idThe prop_id
Exceptions:
key_not_found<prop_id>If the specified property is not present
Returns:
The property value

Definition at line 174 of file object.h.

std::vector< bool > fairport::const_property_object::read_prop_array< bool > ( prop_id  id) const [inline]

Read a property as an array of the given type.

It is the callers responsibility to ensure the prop_id is of or convertable to the requested type.

Template Parameters:
TThe type to interpret he property as
Parameters:
[in]idThe prop_id
Exceptions:
key_not_found<prop_id>If the specified property is not present
Returns:
A vector of the property values
See also:
[MS-PST] 2.3.3.4

Definition at line 210 of file object.h.

virtual size_t fairport::const_property_object::size ( prop_id  id) const [pure virtual]

Returns the total size of a variable length property.

Note:
This operation is only valid for variable length properties
Parameters:
[in]idThe prop_id
Returns:
The vector.size() if read_prop was called for this prop

Implemented in fairport::const_table_row, and fairport::property_bag.


The documentation for this class was generated from the following file: