aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::Link< T > Class Template Reference

Link of a chain list allocated using the SmallObjectAllocator. More...

#include <agrum/base/multidim/FunctionGraphUtilities/link.h>

Public Member Functions

Constructors and Destructors
 Link (const T &elem)
 Constructor.
 Link (const T &elem, Link< T > *nextLink)
 Constructor that insert link before the given link.
 ~Link ()
 Destructor.
void * operator new (size_t s)
 Operator new overload to use the SmallObjectAllocator.
void operator delete (void *p)
 Operator delete overload to use the SmallObjectAllocator.
Getters and setters
const T & element () const
 Returns the element stored in this link.
T & element ()
 Returns the element stored in this link.
const Link< T > * nextLink () const
 Returns next link.
Link< T > * nextLink ()
 Returns next link.
void setNextLink (Link< T > *newLink)
 Sets the next link.

Private Attributes

_element_
 The element embedded in this link.
Link< T > * _nextLink_
 The next link in the list.

Detailed Description

template<typename T>
class gum::Link< T >

Link of a chain list allocated using the SmallObjectAllocator.

Template Parameters
TThe type stored by the chain list.

Definition at line 72 of file link.h.

Constructor & Destructor Documentation

◆ Link() [1/2]

template<typename T>
INLINE gum::Link< T >::Link ( const T & elem)
explicit

Constructor.

Definition at line 59 of file link_tpl.h.

59 : _element_(elem) {
61 }

References Link(), and _element_.

Referenced by Link(), Link(), ~Link(), nextLink(), nextLink(), operator new(), and setNextLink().

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

◆ Link() [2/2]

template<typename T>
INLINE gum::Link< T >::Link ( const T & elem,
Link< T > * nextLink )

Constructor that insert link before the given link.

Definition at line 65 of file link_tpl.h.

65 :
68 }

References Link(), _element_, _nextLink_, and nextLink().

Here is the call graph for this function:

◆ ~Link()

template<typename T>
INLINE gum::Link< T >::~Link ( )

Destructor.

Definition at line 72 of file link_tpl.h.

72 {
74 }

References Link().

Here is the call graph for this function:

Member Function Documentation

◆ element() [1/2]

template<typename T>
INLINE T & gum::Link< T >::element ( )

Returns the element stored in this link.

Definition at line 92 of file link_tpl.h.

92 {
93 return _element_;
94 }

References _element_.

◆ element() [2/2]

◆ nextLink() [1/2]

template<typename T>
INLINE Link< T > * gum::Link< T >::nextLink ( )

Returns next link.

Definition at line 102 of file link_tpl.h.

102 {
103 return _nextLink_;
104 }

References Link(), and _nextLink_.

Here is the call graph for this function:

◆ nextLink() [2/2]

◆ operator delete()

template<typename T>
INLINE void gum::Link< T >::operator delete ( void * p)

Operator delete overload to use the SmallObjectAllocator.

Definition at line 82 of file link_tpl.h.

82 {
84 }
static SmallObjectAllocator & instance()
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.

◆ operator new()

template<typename T>
INLINE void * gum::Link< T >::operator new ( size_t s)

Operator new overload to use the SmallObjectAllocator.

Definition at line 77 of file link_tpl.h.

77 {
79 }
void * allocate(const size_t &objectSize)
Allocates a block.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74

References Link(), gum::SmallObjectAllocator::allocate(), and gum::SmallObjectAllocator::instance().

Here is the call graph for this function:

◆ setNextLink()

template<typename T>
INLINE void gum::Link< T >::setNextLink ( Link< T > * newLink)

Sets the next link.

Definition at line 107 of file link_tpl.h.

107 {
109 }

References Link(), and _nextLink_.

Referenced by gum::LinkedList< NodeId >::~LinkedList().

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

Member Data Documentation

◆ _element_

template<typename T>
T gum::Link< T >::_element_
private

The element embedded in this link.

Definition at line 139 of file link.h.

Referenced by Link(), Link(), element(), and element().

◆ _nextLink_

template<typename T>
Link< T >* gum::Link< T >::_nextLink_
private

The next link in the list.

Definition at line 142 of file link.h.

Referenced by Link(), nextLink(), nextLink(), and setNextLink().


The documentation for this class was generated from the following files:
  • agrum/base/multidim/utils/FunctionGraphUtilities/link.h
  • agrum/base/multidim/utils/FunctionGraphUtilities/link_tpl.h