Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
|
Uses the empty base class optimization in order to compress a potentially empty base class with a member of a class. More...
#include <spatial_compress.hpp>
Inherits Base.
Public Member Functions | |
Compress () | |
Uninitialized compressed base. More... | |
Compress (const Base &compressed_base) | |
Compressed member with uninitialized base. More... | |
Compress (const Base &compressed_base, const Member &member) | |
Standard initializer with Base and Member values. More... | |
const Base & | base () const |
Accessor to the base class. More... | |
Base & | base () |
Accessor to the base class. More... | |
const Member & | operator() () const |
Quick accessor to the member. More... | |
Member & | operator() () |
Quick accessor to the member. More... | |
Private Attributes | |
Member | _member |
Storage for the member value. More... | |
Uses the empty base class optimization in order to compress a potentially empty base class with a member of a class.
Provide the base()
function to access the base class. Provide the operator()
to quickly access the stored member.
Base | The base class that will be compressed through empty member optimization by the compiler, hopefully. |
Member | The member class that will be used as a value for the compression, this class should not be an empty member class. |
Definition at line 46 of file spatial_compress.hpp.
spatial::details::Compress< Base, Member >::Compress | ( | ) |
Uninitialized compressed base.
Definition at line 50 of file spatial_compress.hpp.
|
explicit |
Compressed member with uninitialized base.
compressed_base | The value of the Base type. |
Definition at line 54 of file spatial_compress.hpp.
spatial::details::Compress< Base, Member >::Compress | ( | const Base & | compressed_base, |
const Member & | member | ||
) |
Standard initializer with Base
and Member
values.
compressed_base | The value of the Base type. |
member | The value of the Member type. |
Definition at line 60 of file spatial_compress.hpp.
const Base& spatial::details::Compress< Base, Member >::base | ( | ) | const |
Accessor to the base class.
Definition at line 68 of file spatial_compress.hpp.
Base& spatial::details::Compress< Base, Member >::base | ( | ) |
Accessor to the base class.
Definition at line 72 of file spatial_compress.hpp.
const Member& spatial::details::Compress< Base, Member >::operator() | ( | ) | const |
Quick accessor to the member.
Definition at line 81 of file spatial_compress.hpp.
Member& spatial::details::Compress< Base, Member >::operator() | ( | ) |
Quick accessor to the member.
Definition at line 85 of file spatial_compress.hpp.
|
private |
Storage for the member value.
Definition at line 91 of file spatial_compress.hpp.