SparseFile::FileReferences Class Reference

`#include <SparseFile.h>`

## Public Member Functions

template<>
size_t | append (Reference< double >::Ptr ref)
template<>
size_t | append (Reference< float >::Ptr ref)
template<>
size_t | append (Reference< half >::Ptr ref)
template<>
size_t | append (Reference< V3d >::Ptr ref)
template<>
size_t | append (Reference< V3f >::Ptr ref)
template<>
size_t | append (Reference< V3h >::Ptr ref)
template<class Data_T>
size_t | append (typename Reference< Data_T >::Ptr ref)
| Appends a reference to the collection. This is specialized so that the correct data member is accessed.
long long int | memSize () const
| Returns the memory use for the refs.
template<>
size_t | numRefs () const
template<>
size_t | numRefs () const
template<>
size_t | numRefs () const
template<>
size_t | numRefs () const
template<>
size_t | numRefs () const
template<>
size_t | numRefs () const
template<class Data_T>
size_t | numRefs () const
| Returns the number of file references of the corresponding collection.
template<>
Reference< V3d > * | ref (size_t idx)
template<>
Reference< double > * | ref (size_t idx)
template<>
Reference< V3f > * | ref (size_t idx)
template<>
Reference< float > * | ref (size_t idx)
template<>
Reference< V3h > * | ref (size_t idx)
template<>
Reference< half > * | ref (size_t idx)
template<class Data_T>
Reference< Data_T > * | ref (size_t idx)
| Returns a reference to the index. This is specialized so that the correct data member is accessed.
| ~FileReferences ()

## Private Types

typedef boost::mutex | Mutex

## Private Attributes

std::deque< Reference< double >::Ptr > | m_dRefs
std::deque< Reference< float >::Ptr > | m_fRefs
std::deque< Reference< half >::Ptr > | m_hRefs
Mutex | m_mutex
std::deque< Reference< V3d >::Ptr > | m_vdRefs
std::deque< Reference< V3f >::Ptr > | m_vfRefs
std::deque< Reference< V3h >::Ptr > | m_vhRefs

## Detailed Description

Definition at line 265 of file SparseFile.h.

## Member Typedef Documentation

## Mutex

typedef boost::mutex SparseFile::FileReferences::Mutex

private

Definition at line 314 of file SparseFile.h.

## Constructor & Destructor Documentation

## ~FileReferences()

SparseFile::FileReferences::~FileReferences | ( |  | ) |

inline

Definition at line 896 of file SparseFile.h.

{
#if !USE_SHPTR
for (size_t i = 0, end = m_hRefs.size(); i < end; ++i) {
delete m_hRefs[i];
}
for (size_t i = 0, end = m_fRefs.size(); i < end; ++i) {
delete m_fRefs[i];
}
for (size_t i = 0, end = m_dRefs.size(); i < end; ++i) {
delete m_dRefs[i];
}
for (size_t i = 0, end = m_vhRefs.size(); i < end; ++i) {
delete m_vhRefs[i];
}
for (size_t i = 0, end = m_vfRefs.size(); i < end; ++i) {
delete m_vfRefs[i];
}
for (size_t i = 0, end = m_vdRefs.size(); i < end; ++i) {
delete m_vdRefs[i];
}
#endif
}
SparseFile::FileReferences::m_dRefs
std::deque< Reference< double >::Ptr > m_dRefs
Definition SparseFile.h:309
SparseFile::FileReferences::m_fRefs
std::deque< Reference< float >::Ptr > m_fRefs
Definition SparseFile.h:307
SparseFile::FileReferences::m_vdRefs
std::deque< Reference< V3d >::Ptr > m_vdRefs
Definition SparseFile.h:310
SparseFile::FileReferences::m_vfRefs
std::deque< Reference< V3f >::Ptr > m_vfRefs
Definition SparseFile.h:308
SparseFile::FileReferences::m_hRefs
std::deque< Reference< half >::Ptr > m_hRefs
Definition SparseFile.h:305
SparseFile::FileReferences::m_vhRefs
std::deque< Reference< V3h >::Ptr > m_vhRefs
Definition SparseFile.h:306

References m_dRefs, m_fRefs, m_hRefs, m_vdRefs, m_vfRefs, and m_vhRefs.

## Member Function Documentation

## ref() [1/7]

template<class Data_T>

Reference< Data_T > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

Returns a reference to the index. This is specialized so that the correct data member is accessed.

Referenced by append(), append(), append(), append(), append(), append(), and append().

## append() [1/7]

template<class Data_T>

size_t SparseFile::FileReferences::append | ( | typename Reference< Data_T >::Ptr | ref | ) |

Appends a reference to the collection. This is specialized so that the correct data member is accessed.

References ref().

## numRefs() [1/7]

template<class Data_T>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

Returns the number of file references of the corresponding collection.

## memSize()

long long int SparseFile::FileReferences::memSize | ( |  | ) | const

Returns the memory use for the refs.

Definition at line 452 of file SparseFile.cpp.

{
Mutex::scoped_lock lock(m_mutex);
long long int size = 0;
// Size of the std::deque's
size += m_hRefs.size() * sizeof(Reference<half>::Ptr);
size += m_vhRefs.size() * sizeof(Reference<V3h>::Ptr);
size += m_fRefs.size() * sizeof(Reference<float>::Ptr);
size += m_vfRefs.size() * sizeof(Reference<V3f>::Ptr);
size += m_dRefs.size() * sizeof(Reference<double>::Ptr);
size += m_vdRefs.size() * sizeof(Reference<V3d>::Ptr);
// Size of the references themselves
for (size_t i = 0, end = m_hRefs.size(); i < end; ++i) {
size += m_hRefs[i]->memSize();
}
for (size_t i = 0, end = m_vhRefs.size(); i < end; ++i) {
size += m_vhRefs[i]->memSize();
}
for (size_t i = 0, end = m_fRefs.size(); i < end; ++i) {
size += m_fRefs[i]->memSize();
}
for (size_t i = 0, end = m_vfRefs.size(); i < end; ++i) {
size += m_vfRefs[i]->memSize();
}
for (size_t i = 0, end = m_dRefs.size(); i < end; ++i) {
size += m_dRefs[i]->memSize();
}
for (size_t i = 0, end = m_vdRefs.size(); i < end; ++i) {
size += m_vdRefs[i]->memSize();
}
return size;
}
SparseFile::FileReferences::m_mutex
Mutex m_mutex
Definition SparseFile.h:316
SparseFile::Reference::Ptr
Reference * Ptr
Definition SparseFile.h:116

References m_dRefs, m_fRefs, m_hRefs, m_mutex, m_vdRefs, m_vfRefs, and m_vhRefs.

## ref() [2/7]

template<>

Reference< half > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 924 of file SparseFile.h.

{
#if USE_SHPTR
return m_hRefs[idx].get();
#else
return m_hRefs[idx];
#endif
}

References m_hRefs.

## ref() [3/7]

template<>

Reference< V3h > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 937 of file SparseFile.h.

{
#if USE_SHPTR
return m_vhRefs[idx].get();
#else
return m_vhRefs[idx];
#endif
}

References m_vhRefs.

## ref() [4/7]

template<>

Reference< float > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 950 of file SparseFile.h.

{
#if USE_SHPTR
return m_fRefs[idx].get();
#else
return m_fRefs[idx];
#endif
}

References m_fRefs.

## ref() [5/7]

template<>

Reference< V3f > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 963 of file SparseFile.h.

{
#if USE_SHPTR
return m_vfRefs[idx].get();
#else
return m_vfRefs[idx];
#endif
}

References m_vfRefs.

## ref() [6/7]

template<>

Reference< double > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 976 of file SparseFile.h.

{
#if USE_SHPTR
return m_dRefs[idx].get();
#else
return m_dRefs[idx];
#endif
}

References m_dRefs.

## ref() [7/7]

template<>

Reference< V3d > * SparseFile::FileReferences::ref | ( | size_t | idx | ) |

inline

Definition at line 989 of file SparseFile.h.

{
#if USE_SHPTR
return m_vdRefs[idx].get();
#else
return m_vdRefs[idx];
#endif
}

References m_vdRefs.

## append() [2/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< half >::Ptr | ref | ) |

inline

Definition at line 1001 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_hRefs.push_back(ref);
return m_hRefs.size() - 1;
}
SparseFile::FileReferences::ref
Reference< Data_T > * ref(size_t idx)
Returns a reference to the index. This is specialized so that the correct data member is accessed.

References m_hRefs, m_mutex, and ref().

## append() [3/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< V3h >::Ptr | ref | ) |

inline

Definition at line 1012 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_vhRefs.push_back(ref);
return m_vhRefs.size() - 1;
}

References m_mutex, m_vhRefs, and ref().

## append() [4/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< float >::Ptr | ref | ) |

inline

Definition at line 1023 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_fRefs.push_back(ref);
return m_fRefs.size() - 1;
}

References m_fRefs, m_mutex, and ref().

## append() [5/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< V3f >::Ptr | ref | ) |

inline

Definition at line 1034 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_vfRefs.push_back(ref);
return m_vfRefs.size() - 1;
}

References m_mutex, m_vfRefs, and ref().

## append() [6/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< double >::Ptr | ref | ) |

inline

Definition at line 1045 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_dRefs.push_back(ref);
return m_dRefs.size() - 1;
}

References m_dRefs, m_mutex, and ref().

## append() [7/7]

template<>

size_t SparseFile::FileReferences::append | ( | Reference< V3d >::Ptr | ref | ) |

inline

Definition at line 1056 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
m_vdRefs.push_back(ref);
return m_vdRefs.size() - 1;
}

References m_mutex, m_vdRefs, and ref().

## numRefs() [2/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1067 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_hRefs.size();
}

References m_hRefs, and m_mutex.

## numRefs() [3/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1077 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_vhRefs.size();
}

References m_mutex, and m_vhRefs.

## numRefs() [4/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1087 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_fRefs.size();
}

References m_fRefs, and m_mutex.

## numRefs() [5/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1097 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_vfRefs.size();
}

References m_mutex, and m_vfRefs.

## numRefs() [6/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1107 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_dRefs.size();
}

References m_dRefs, and m_mutex.

## numRefs() [7/7]

template<>

size_t SparseFile::FileReferences::numRefs | ( |  | ) | const

inline

Definition at line 1117 of file SparseFile.h.

{
Mutex::scoped_lock lock(m_mutex);
return m_vdRefs.size();
}

References m_mutex, and m_vdRefs.

## Member Data Documentation

## m_hRefs

std::deque<Reference<half>::Ptr> SparseFile::FileReferences::m_hRefs

private

Definition at line 305 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_vhRefs

std::deque<Reference<V3h>::Ptr> SparseFile::FileReferences::m_vhRefs

private

Definition at line 306 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_fRefs

std::deque<Reference<float>::Ptr> SparseFile::FileReferences::m_fRefs

private

Definition at line 307 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_vfRefs

std::deque<Reference<V3f>::Ptr> SparseFile::FileReferences::m_vfRefs

private

Definition at line 308 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_dRefs

std::deque<Reference<double>::Ptr> SparseFile::FileReferences::m_dRefs

private

Definition at line 309 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_vdRefs

std::deque<Reference<V3d>::Ptr> SparseFile::FileReferences::m_vdRefs

private

Definition at line 310 of file SparseFile.h.

Referenced by append(), memSize(), numRefs(), ref(), and ~FileReferences().

## m_mutex

Mutex SparseFile::FileReferences::m_mutex

mutable private

Definition at line 316 of file SparseFile.h.

Referenced by append(), append(), append(), append(), append(), append(), memSize(), and numRefs().

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

- export/SparseFile.h
- src/SparseFile.cpp