Public Types | Public Member Functions | List of all members
LabelInfoCollection< TLabelInformation > Class Template Referenceabstract

Information collection for class labels. More...

#include <cvb/sample_database/sample_list.hpp>

Public Types

using LabelType = typename TLabelInformation::LabelType
 Type of the labels.
 

Public Member Functions

int Count () const
 Retrieves the number of elements in the collection. More...
 
TLabelInformation ReadInfo (int index) const
 Retrieves the indexed item. More...
 
std::vector< TLabelInformation > ReadInfos () const
 Retrieves all the items stored in the collection. More...
 
void RemoveAt (int index)
 Remove a class by index. More...
 
void Remove (const LabelType &label)
 Remove a class and all the data objects associated with it based on its name. More...
 
void Clear ()
 Remove all labels (and their associated data) from the sample list. More...
 
void MergeClasses (int fromIndex, int toIndex)
 Merge two classes into one class. More...
 
void MergeClasses (const LabelType &fromLabel, const LabelType &toLabel)
 Merge two classes into one class. More...
 

Detailed Description

template<class TLabelInformation>
class Cvb::SampleDatabase::LabelInfoCollection< TLabelInformation >

Information collection for class labels.

Member Function Documentation

◆ Clear()

void Clear ( )
inline

Remove all labels (and their associated data) from the sample list.

Exceptions
Anyexception derived from std::exception including CvbException.

Note that this invalidates all info objects that have been taken from this collection!

◆ Count()

int Count ( ) const
inline

Retrieves the number of elements in the collection.

Returns
Number of elements in the collection.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ MergeClasses() [1/2]

void MergeClasses ( int  fromIndex,
int  toIndex 
)
inline

Merge two classes into one class.

Parameters
[in]fromIndexClass to merge to the other classes.
[in]toIndexClass to merge the samples to.
Exceptions
Anyexception derived from std::exception including CvbException.

The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromIndex.

◆ MergeClasses() [2/2]

void MergeClasses ( const LabelType fromLabel,
const LabelType toLabel 
)
inline

Merge two classes into one class.

Parameters
[in]fromLabelClass to merge to the other classes.
[in]toLabelClass to merge the samples to.
Exceptions
Anyexception derived from std::exception including CvbException.

The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than fromLabel.

◆ ReadInfo()

TLabelInformation ReadInfo ( int  index) const
inline

Retrieves the indexed item.

Parameters
[in]indexIndex of the collection to be accessed.
Returns
Label information.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ReadInfos()

std::vector<TLabelInformation> ReadInfos ( ) const
inline

Retrieves all the items stored in the collection.

Returns
The collection items.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Remove()

void Remove ( const LabelType label)
inline

Remove a class and all the data objects associated with it based on its name.

Parameters
[in]labelName of the new class to be removed.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RemoveAt()

void RemoveAt ( int  index)
inline

Remove a class by index.

Parameters
[in]indexIndex of the class to be removed.
Exceptions
Anyexception derived from std::exception including CvbException.