Tracore
Public Member Functions | Protected Member Functions | List of all members
core::ObjectDataMap Class Reference

#include <ObjectDataMap.h>

Inheritance diagram for core::ObjectDataMap:
core::ObjectData

Public Member Functions

 ObjectDataMap (size_t frame_index)
 
 ObjectDataMap (size_t frame_index, std::vector< std::string > keys, std::vector< double > value_list)
 
 ObjectDataMap (size_t frame_index, std::vector< std::string > keys, std::vector< double > value_list, std::vector< double > weight_list)
 
 ObjectDataMap (size_t frame_index, std::vector< std::string > keys, std::vector< std::pair< double, double >> value_weight_list)
 
double GetValue (std::string key)
 
double GetWeight (std::string key)
 
void PutValueWeight (std::string key, double value, double weight)
 
void PutValueWeight (std::string key, std::pair< double, double > value_weight)
 
virtual double CompareTo (ObjectData *obj)
 
virtual double CompareTo (ObjectDataMap *obj)
 
- Public Member Functions inherited from core::ObjectData
 ObjectData ()
 
 ObjectData (std::size_t frame_index)
 
std::size_t GetFrameIndex () const
 
bool IsVirtual () const
 

Protected Member Functions

virtual void Print (std::ostream &os) const
 

Additional Inherited Members

- Protected Attributes inherited from core::ObjectData
std::size_t frame_index_
 

Detailed Description

Stores a map of key-value-weight pairs. The weight is used to compare this object with other objects.

Constructor & Destructor Documentation

core::ObjectDataMap::ObjectDataMap ( size_t  frame_index)

Creates a new empty object data map.

Parameters
frame_indexThe index of the frame this object was detected in
core::ObjectDataMap::ObjectDataMap ( size_t  frame_index,
std::vector< std::string >  keys,
std::vector< double >  value_list 
)

Creates a object data map with the given keys and values and an equal weight for every value.

Parameters
frame_indexThe index of the frame this object was detected in
keysThe keys for the values to store
value_listThe values to store with the given keys
core::ObjectDataMap::ObjectDataMap ( size_t  frame_index,
std::vector< std::string >  keys,
std::vector< double >  value_list,
std::vector< double >  weight_list 
)

Creates a object data map with the given keys and values and an given weight for the corresponding key-value pair.

Parameters
frame_indexThe index of the frame this object was detected in
keysThe keys for the values to store
value_listThe values to store with the given keys
weight_listThe weights to store with the given key-value pairs
core::ObjectDataMap::ObjectDataMap ( size_t  frame_index,
std::vector< std::string >  keys,
std::vector< std::pair< double, double >>  value_weight_list 
)

Creates a object data map with the given keys and value-weight pairs.

Parameters
frame_indexThe index of the frame this object was detected in
keysThe keys for the values to store
value_weight_listThe value-weight-pairs to store with the keys

Member Function Documentation

double core::ObjectDataMap::CompareTo ( ObjectData obj)
virtual

Compares this object with the given object by calculating the difference in every value and applies the corresponding weight to that difference. Than all weighted differences are summed up.

Parameters
objA pointer to the object to compare this object to
Returns
The summed up weighted differences

Reimplemented from core::ObjectData.

double core::ObjectDataMap::CompareTo ( ObjectDataMap obj)
virtual

Compares this object with the given object by calculating the difference in every value and applies the corresponding weight to that difference. Than all weighted differences are summed up.

Parameters
objA pointer to the object to compare this object to
Returns
The summed up weighted differences
double core::ObjectDataMap::GetValue ( std::string  key)

Gets the value of the given key.

Parameters
keyThe key for the value
Returns
The value
double core::ObjectDataMap::GetWeight ( std::string  key)

Gets the weight of the given key.

Parameters
keyThe key for the value
Returns
The weight
void core::ObjectDataMap::Print ( std::ostream &  os) const
protectedvirtual

Used in the << operator

Parameters
osThe stream to write to

Reimplemented from core::ObjectData.

void core::ObjectDataMap::PutValueWeight ( std::string  key,
double  value,
double  weight 
)

Stores the given value-weight pair with the given key. If the key is already stored it will be overridden with the new pair.

Parameters
keyThe key to store the value-weight pair at
valueThe value of the value-weight pair
weightThe weight of the value-weight pair
void core::ObjectDataMap::PutValueWeight ( std::string  key,
std::pair< double, double >  value_weight 
)

Stores the given value-weight pair with the given key. If the key is already stored it will be overridden with the new pair.

Parameters
keyThe key to store the value-weight pair at
value_weightThe value-weight pair

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