Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS::JGarbageCollection< JKey_t, JValue_t > Class Template Reference

Garbage collection. More...

#include <JGarbageCollection.hh>

Inheritance diagram for JTOOLS::JGarbageCollection< JKey_t, JValue_t >:
JTOOLS::JMappableCollection< JKey_t, JValue_t >

Public Types

typedef JMappableCollection< JKey_t, JValue_t > mappablecollection_type
 
typedef mappablecollection_type::key_type key_type
 
typedef mappablecollection_type::mapped_type mapped_type
 

Public Member Functions

virtual void clear () override
 Clear.
 
virtual const mapped_typeget (typename JLANG::JClass< key_type >::argument_type key) const override
 Get mapped value.
 
virtual mapped_typeget (typename JLANG::JClass< key_type >::argument_type key) override
 Get mapped value.
 
const mapped_typeoperator[] (typename JClass< key_type >::argument_type key) const
 Get mapped value.
 
mapped_typeoperator[] (typename JClass< key_type >::argument_type key)
 Get mapped value.
 
void put (typename JClass< key_type > ::argument_type key, typename JClass< mapped_type >::argument_type value)
 Put pair-wise element (key,value) into collection.
 

Private Attributes

mapped_type value
 

Detailed Description

template<class JKey_t, class JValue_t>
class JTOOLS::JGarbageCollection< JKey_t, JValue_t >

Garbage collection.

This class implements the JMappableCollection interface but does nothing.

Definition at line 22 of file JGarbageCollection.hh.

Member Typedef Documentation

◆ mappablecollection_type

template<class JKey_t , class JValue_t >
JMappableCollection<JKey_t, JValue_t> JTOOLS::JGarbageCollection< JKey_t, JValue_t >::mappablecollection_type

Definition at line 27 of file JGarbageCollection.hh.

◆ key_type

template<class JKey_t , class JValue_t >
mappablecollection_type::key_type JTOOLS::JGarbageCollection< JKey_t, JValue_t >::key_type

Definition at line 29 of file JGarbageCollection.hh.

◆ mapped_type

template<class JKey_t , class JValue_t >
mappablecollection_type::mapped_type JTOOLS::JGarbageCollection< JKey_t, JValue_t >::mapped_type

Definition at line 30 of file JGarbageCollection.hh.

Member Function Documentation

◆ clear()

template<class JKey_t , class JValue_t >
virtual void JTOOLS::JGarbageCollection< JKey_t, JValue_t >::clear ( )
inlineoverridevirtual

Clear.

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 36 of file JGarbageCollection.hh.

37 {}

◆ get() [1/2]

template<class JKey_t , class JValue_t >
virtual const mapped_type & JTOOLS::JGarbageCollection< JKey_t, JValue_t >::get ( typename JLANG::JClass< key_type >::argument_type key) const
inlineoverridevirtual

Get mapped value.

Parameters
keykey
Returns
value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 46 of file JGarbageCollection.hh.

47 {
48 return value;
49 }

◆ get() [2/2]

template<class JKey_t , class JValue_t >
virtual mapped_type & JTOOLS::JGarbageCollection< JKey_t, JValue_t >::get ( typename JLANG::JClass< key_type >::argument_type key)
inlineoverridevirtual

Get mapped value.

Parameters
keykey
Returns
value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 58 of file JGarbageCollection.hh.

59 {
60 return value;
61 }

◆ operator[]() [1/2]

template<class JKey_t , class JValue_t >
const mapped_type & JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type key) const
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 73 of file JMappableCollection.hh.

74 {
75 return get(key);
76 }
virtual const mapped_type & get(typename JClass< key_type >::argument_type key) const =0
Get mapped value.

◆ operator[]() [2/2]

template<class JKey_t , class JValue_t >
mapped_type & JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type key)
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 85 of file JMappableCollection.hh.

86 {
87 return get(key);
88 }

◆ put()

template<class JKey_t , class JValue_t >
void JTOOLS::JMappableCollection< JKey_t, JValue_t >::put ( typename JClass< key_type > ::argument_type key,
typename JClass< mapped_type >::argument_type value )
inlineinherited

Put pair-wise element (key,value) into collection.

Parameters
keykey
valuevalue

Definition at line 97 of file JMappableCollection.hh.

99 {
100 get(key) = value;
101 }

Member Data Documentation

◆ value

template<class JKey_t , class JValue_t >
mapped_type JTOOLS::JGarbageCollection< JKey_t, JValue_t >::value
private

Definition at line 64 of file JGarbageCollection.hh.


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