File kernel/src/utils/SiconosTools/SiconosProperties.hpp

Contents

File kernel/src/utils/SiconosTools/SiconosProperties.hpp#

Go to the source code of this file

Exterior properties to vertices or edges of a SiconosGraph can be attach with Siconos::Properties. These properties are referenced with vertices or edges indices. update_vertices_indices() or update_edges_indices() must have been done after any vertices or edges insertion or deletion.

Defines

I_DECLARE_MEMBERS(r, gt, p)#
I_CONS_MEMBERS(r, gt, p)#
INSTALL_GRAPH_PROPERTIES(GraphType, PROPERTIES)#
template<typename T>
struct IsSharedPtr<std::shared_ptr<T>> : public boost::mpl::true_#
template<typename T>
struct RemovePointer<std::shared_ptr<T>>#

Public Types

typedef T type#
namespace Siconos

Functions

template<typename T, typename G>
VertexProperties<T, G> vertexProperties(G &g)#

function to build a VertexProperties from one template parameter

Parameters:

g – the graph

template<typename T, typename G>
EdgeProperties<T, G> edgeProperties(G &g)#

function to build a EdgeProperties from one template parameter

Parameters:

g – the graph

template<typename T>
struct IsSharedPtr : public boost::mpl::false_#
#include <SiconosProperties.hpp>

some local type traits

template<typename T> shared_ptr< T > > : public boost::mpl::true_
template<typename T>
struct IsPointer : public boost::mpl::or_<boost::is_pointer<T>, IsSharedPtr<T>>#
template<typename T>
struct RemovePointer#

Public Types

typedef T type#
template<typename T> shared_ptr< T > >

Public Types

typedef T type#
template<typename G>
struct VertexAccess#
#include <SiconosProperties.hpp>

get vertex needed data

Public Types

typedef VertexAccess type#
typedef G::VDescriptor descriptor#
typedef G::VIterator iterator#

Public Functions

inline std::pair<iterator, iterator> elements(G &g)#
inline size_t size(G &g)#
inline bool isElem(G &g, typename G::VDescriptor &vd)#
template<typename G>
struct EdgeAccess#
#include <SiconosProperties.hpp>

get edge needed data

Public Types

typedef EdgeAccess type#
typedef G::EDescriptor descriptor#
typedef G::EIterator iterator#

Public Functions

inline std::pair<iterator, iterator> elements(G &g)#
inline bool isElem(G &g, typename G::EDescriptor &ed)#

Public Static Functions

static inline size_t size(const G &g)#
template<typename G, typename IndexMap>
struct VertexOrEdge#
#include <SiconosProperties.hpp>

choose vertex or edge access according to IndexMap

Public Types

typedef boost::mpl::if_<boost::is_same<typename G::VIndexAccess, IndexMap>, VertexAccess<G>, EdgeAccess<G>>::type Access#
template<typename T>
struct SwapPointedValues#
#include <SiconosProperties.hpp>

swap data

Public Types

typedef SwapPointedValues type#

Public Functions

inline void operator()(T a, T b)#
template<typename T>
struct SwapValues#

Public Types

typedef SwapValues type#

Public Functions

inline void operator()(T &a, T &b)#
template<typename T>
struct SwapProperties#

Public Types

typedef boost::mpl::if_<IsPointer<T>, SwapPointedValues<T>, SwapValues<T>>::type type#
template<typename T>
struct GetPointedValue#

Public Types

typedef GetPointedValue type#

Public Functions

inline RemovePointer<T>::type &operator()(T a)#
template<typename T>
struct GetValue#

Public Types

typedef GetValue type#

Public Functions

inline T &operator()(T &a)#
template<typename T>
struct GetProperty#

Public Types

typedef boost::mpl::if_<IsPointer<T>, GetPointedValue<T>, GetValue<T>>::type type#
template<typename T, typename G, typename IndexMap>
class Properties#
#include <SiconosProperties.hpp>

the general properties structure, from boost::vector_property_map :

Param T:

the property data type

Param G:

the graph type

Param IndexMap:

the index map, should be either G::VIndexAccess or G:EIndexAccess

Subclassed by Siconos::VertexProperties< std::shared_ptr< T >, G >

Public Types

typedef VertexOrEdge<G, IndexMap>::Access Access#
typedef boost::property_traits<IndexMap>::key_type key_type#
typedef T value_type#
typedef std::iterator_traits<typename std::vector<T>::iterator>::reference reference#
typedef boost::lvalue_property_map_tag category#
typedef void serializable#

Public Functions

inline Properties(G &g)#

constructor from a SiconosGraph

Parameters:

g – a SiconosGraph

inline void insert(const key_type &v, T t)#

insert an element in the Property descriptor

Parameters:
  • v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

  • t – the element to be inserted

inline reference operator[](const key_type &v)#

data access from a SiconosGraph vertex descriptor or edge descriptor

Warning

this operator creates an empty element if the key is not in the map. Dot not use it to test if a key is present or not in the map …

Parameters:

v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

Returns:

the element in the vector

inline value_type at(const key_type &v)#

data access from a SiconosGraph vertex descriptor or edge descriptor

Parameters:

v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

inline reference find(const key_type &v)#

find data associated with the given key

Parameters:

v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

Returns:

an iterator

inline bool hasKey(const key_type &v)#

check if a given property exists

Parameters:

v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

Returns:

true if the key is a property, otherwise false

Public Members

Access access#
G &_g#
std::shared_ptr<std::map<key_type, T>> _store#
int _stamp#
template<typename T, typename G>
class VertexProperties : public Siconos::Properties<T, G, G::VIndexAccess>#
#include <SiconosProperties.hpp>

vertex property structure:

Param T:

the property data type

Param G:

the graph type

Public Types

typedef void serializable#

Public Functions

inline VertexProperties(G &g)#
template<typename T, typename G>
class VertexSPProperties : public Siconos::VertexProperties<std::shared_ptr<T>, G>#
#include <SiconosProperties.hpp>

vertex property structure with shared_pre

Param T:

the property data type

Param G:

the graph type

Public Types

typedef boost::property_traits<typename G::VIndexAccess>::key_type key_type#
typedef void serializable#

Public Functions

inline VertexSPProperties(G &g)#
inline T &getRef(const key_type &v)#

data access from a SiconosGraph vertex descriptor or edge descriptor

Warning

this operator creates an empty element if the key is not in the map. Dot not use it to test if a key os present or not in the map …

Parameters:

v – a SiconosGraph::VDescriptor or SiconosGraph::EDescriptor according to IndexMap type

Returns:

the element in the vector

template<typename T, typename G>
class EdgeProperties : public Siconos::Properties<T, G, G::EIndexAccess>#
#include <SiconosProperties.hpp>

edge property structure:

Param T:

the property data type

Param G:

the graph type

Public Types

typedef void serializable#

Public Functions

inline EdgeProperties(G &g)#
template<typename T, typename G, typename IndexMap>
class SubProperties#
#include <SiconosProperties.hpp>

global properties : they may be attached to main graph and may be referenced from subgraphs.

They are not used for the moment

Public Functions

inline SubProperties(RefProperties &p, G &g)#
inline reference operator[](const key_type &v)#

Private Types

typedef Properties<T, G, IndexMap> RefProperties#
typedef boost::property_traits<IndexMap>::key_type key_type#
typedef T value_type#
typedef std::iterator_traits<typename std::vector<T>::iterator>::reference reference#
typedef boost::lvalue_property_map_tag category#

Private Members

RefProperties _properties#
G &_g#
template<typename T, typename G>
class VertexSubProperties : public Siconos::SubProperties<T, G, G::VIndexAccess>#

Public Types

typedef Properties<T, G, typename G::VIndexAccess> RefProperties#

Public Functions

inline VertexSubProperties(RefProperties &p, G &g)#
template<typename T, typename G>
class EdgeSubProperties : public Siconos::SubProperties<T, G, G::EIndexAccess>#

Public Types

typedef Properties<T, G, typename G::EIndexAccess> RefProperties#

Public Functions

inline EdgeSubProperties(RefProperties &p, G &g)#