Properties ========== :cpp:include:`#include` Properties map from element ids to other stuff. .. cpp:namespace:: hysj .. cpp:namespace-push:: graphs In namespace :cpp:any:`graphs`: .. cpp:function:: auto put(auto &p,auto i,auto &&v) | Hook to put value :cpp:expr:`v` to property of id :cpp:expr:`i`. | .. cpp:function:: auto get(auto &p,auto i) | Hook to get property of :cpp:expr:`i`. *Traits* .. cpp:type:: template traits::get_t *Let* .. cpp:var:: P p I i | Computes the return type of :cpp:expr:`get(p,i)`. | .. cpp:function:: auto fill(auto &p,auto &&v) | Hook to write value :cpp:expr:`v` to all ids. | .. cpp:concept:: template concepts::property *Let* .. cpp:var:: P p I i traits::get_t v *Requires* :cpp:expr:`graphs::get(p,i)` :cpp:expr:`graphs::put(p,i,v)` | .. cpp:concept:: template concepts::element_property *Requires* :cpp:expr:`concepts::property>` | .. cpp:concept:: template concepts::element_property_of *Requires* :cpp:expr:`concepts::element_property` :cpp:expr:`std::convertible_to>,V>` | Builtin ------- .. cpp:namespace-push:: builtin In namespace :cpp:any:`builtin`: Vector Properties ^^^^^^^^^^^^^^^^^ :cpp:include:`#include` Implementation of a property based on :cppref:`std::vector `. .. cpp:function:: template auto make_vector_property(constant_t e,const graphs::concepts::elements auto &g,V v) | Make a vector property for the elements of type :cpp:expr:`T` for the graph :cpp:expr:`g`, initializing the values with :cpp:expr:`v`. *Shorthands* .. rest-script:: from hysj.graphs import ElementTag as Enum for e in Enum.__members__.values(): print(f'.. cpp:var:: unspecified {e.name[0]}prop = bind(make_vector_property,{e.name}_tag)') Constant Property ^^^^^^^^^^^^^^^^^ :cpp:include:`#include` Implementation of property with a constant value for any element. .. cpp:struct:: template constant_property .. cpp:member:: T value | Constant value. | Implements :cpp:concept:`concepts::element_property_of` for any element, graph and any :cpp:type:`U` convertible from :cpp:type:`T`. Static Property ^^^^^^^^^^^^^^^ :cpp:include:`#include` Implementation of property with a static value for any element. .. cpp:struct:: template static_property | Implements :cpp:concept:`concepts::element_property_of` for any element, graph and any :cpp:type:`U` convertible from :cpp:expr:`T`. .. cpp:namespace-pop:: .. cpp:namespace-pop::