ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
active::serialise::xml::XMLSolidPolygon< Vert, VertWrap > Class Template Reference

#include <XMLPolygon.h>

Inheritance diagram for active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >:
Inheritance graph
[legend]
Collaboration diagram for active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >:
Collaboration graph
[legend]

Public Types

enum  FieldIndex { vertex , topID }
 Serialisation fields.
 
using base = std::reference_wrapper<geometry::Polygon>
 
- Public Types inherited from active::serialise::Package
using Unique = std::unique_ptr<Package>
 Unique pointer.
 
using Shared = std::shared_ptr<Package>
 Shared pointer.
 
- Public Types inherited from active::serialise::Cargo
using Unique = std::unique_ptr<Cargo>
 Unique pointer.
 
using Shared = std::shared_ptr<Cargo>
 Shared pointer.
 
using size_type = std::string::size_type
 Class size type.
 
using sizeOption = std::optional<size_type>
 Optional size type (used to indicate an unspecified or non-existant position)
 

Public Member Functions

 XMLSolidPolygon (const geometry::Polygon &polygon)
 
 XMLSolidPolygon (const geometry::Polygon &polygon, const utility::String &customTag)
 
virtual bool fillInventory (Inventory &inventory) const override
 
virtual Cargo::Unique getCargo (const Inventory::Item &item) const override
 
virtual void setDefault () override
 
virtual bool validate () override
 
virtual bool insert (Cargo::Unique &&cargo, const Inventory::Item &item) override
 
- Public Member Functions inherited from active::serialise::Package
bool isRoot () const
 
virtual bool isAttributeFirst () const
 
virtual bool read (const utility::String &source)
 
void setRoot (bool state)
 
virtual bool finaliseAttributes ()
 
- Public Member Functions inherited from active::serialise::Cargo
 Cargo ()
 
 Cargo (const Cargo &source)
 
virtual ~Cargo ()=default
 
virtual void clear ()
 

Static Public Attributes

static utility::String tag = "polygon"
 The default element tag.
 
static std::array fieldID
 Serialisation field IDs.
 

Detailed Description

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
requires IsPolyPoint<Vert> && IsPointWrap<VertWrap>
class active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >

A serialisation wrapper for a solid Polygon (no holes)

While explicitly supporting XML, this class should work equally well for JSON and probably CSV serialisation This is a template to support the deserialisation of vertex objects derived from PolyPoint

Constructor & Destructor Documentation

◆ XMLSolidPolygon() [1/2]

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::XMLSolidPolygon ( const geometry::Polygon & polygon)
inline

Constructor

Parameters
polygonThe polygon to wrap for (de)serialisation
Here is the call graph for this function:

◆ XMLSolidPolygon() [2/2]

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::XMLSolidPolygon ( const geometry::Polygon & polygon,
const utility::String & customTag )
inline

Constructor

Parameters
polygonThe polygon to wrap for (de)serialisation
customTagA custom tag (overrides the default tag)
Here is the call graph for this function:

Member Function Documentation

◆ fillInventory()

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
virtual bool active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::fillInventory ( Inventory & inventory) const
inlineoverridevirtual

Fill an inventory with the package items

Parameters
inventoryThe inventory to receive the package items
Returns
True if the package has added items to the inventory

Implements active::serialise::Cargo.

Reimplemented in active::serialise::xml::XMLPolygon< Vert, VertWrap, Hole, HoleWrap >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCargo()

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
virtual Cargo::Unique active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::getCargo ( const Inventory::Item & item) const
inlineoverridevirtual

Get the specified cargo

Parameters
itemThe inventory item to retrieve
Returns
The requested cargo (nullptr on failure)

Implements active::serialise::Cargo.

Reimplemented in active::serialise::xml::XMLPolygon< Vert, VertWrap, Hole, HoleWrap >.

Here is the caller graph for this function:

◆ insert()

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
virtual bool active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::insert ( Cargo::Unique && cargo,
const Inventory::Item & item )
inlineoverridevirtual

Insert specified cargo into the package - used for cargo with many instances sharing the same ID (e.g. from an array/map)

Parameters
cargoThe cargo to insert
itemThe inventory item linked with the cargo
Returns
True if the cargo was accepted (false will trigger an import failure - simply discard if this is not an error)

Reimplemented from active::serialise::Package.

Reimplemented in active::serialise::xml::XMLPolygon< Vert, VertWrap, Hole, HoleWrap >.

Here is the caller graph for this function:

◆ setDefault()

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
virtual void active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::setDefault ( )
inlineoverridevirtual

Set to the default package content

Reimplemented from active::serialise::Package.

◆ validate()

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
virtual bool active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::validate ( )
inlineoverridevirtual

Validate the cargo data

Returns
True if the data has been validated

Reimplemented from active::serialise::Cargo.

Member Data Documentation

◆ fieldID

template<class Vert = geometry::PolyPoint, class VertWrap = XMLPolyPoint>
std::array active::serialise::xml::XMLSolidPolygon< Vert, VertWrap >::fieldID
inlinestatic
Initial value:
= {
Identity{"vertex"},
Identity{"topID"},
}
Definition Identity.h:18

Serialisation field IDs.


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