1#ifndef DATAMODEL_DATALINK_H
2#define DATAMODEL_DATALINK_H
4#ifndef DATAMODEL_TOOLS_DATAPROXYSTORAGE_H
5# include "DataModel/tools/DataProxyStorage.h"
24template <
typename STORABLE,
class StoragePolicy = DataProxyStorage<STORABLE>>
27 typedef typename StoragePolicy::ID_type
ID_type;
30 typedef typename StoragePolicy::pointer
pointer;
32 typedef typename StoragePolicy::reference
reference;
37 DataLink( IProxyDict* sg = StoragePolicy::defaultDataSource() ) : StoragePolicy( sg ) {}
41 : StoragePolicy(
data, sg ) {}
46 : StoragePolicy( pdata, sg ) {}
50 : StoragePolicy(
dataID, sg ) {}
74 using StoragePolicy::clear;
75 using StoragePolicy::reset;
82template <
class OS,
typename STORABLE,
class StoragePolicy>
85template <
class IS,
typename STORABLE,
class StoragePolicy>
88#include "DataModel/DataLink.icc"
90#ifndef DATAMODEL_TOOLS_PLAINPTRSTORAGE_H
91# include "DataModel/tools/PlainPtrStorage.h"
OS & operator<<(OS &os, DataLink< STORABLE, StoragePolicy > &link)
IS & operator>>(IS &is, DataLink< STORABLE, StoragePolicy > &link)
a persistable pointer to a STORABLE (data object)
DataLink(IProxyDict *sg=StoragePolicy::defaultDataSource())
links to the default object of type STORABLE
const_reference operator*() const
StoragePolicy::reference reference
void toStorableObject(const_reference data)
set link to data object pointed by data
void toIdentifiedObject(const ID_type &dataID)
set link using data object key
StoragePolicy::value_type value_type
DataLink(const ID_type &dataID, IProxyDict *sg=StoragePolicy::defaultDataSource())
link to a STORABLE using its ID
StoragePolicy::const_pointer const_pointer
StoragePolicy::const_reference const_reference
DataLink(const_reference data, IProxyDict *sg=StoragePolicy::defaultDataSource())
link to a STORABLE using a transient ref to it
StoragePolicy::ID_type ID_type
StoragePolicy::pointer pointer
const_pointer cptr() const
DataLink(const_pointer pdata, IProxyDict *sg=StoragePolicy::defaultDataSource())
void toDefaultObject()
set link to default data object (of type const_reference)
const_pointer operator->() const
const ID_type & dataID() const
DataLink< STORABLE, PlainPtrStorage< STORABLE > > type