TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/NodeAtTimeKey.cpp
Go to the documentation of this file.
00001 #include "NodeAtTimeKey.hpp"
00002 
00003 #include <boost/functional/hash.hpp>
00004 
00005 namespace tuttle {
00006 namespace host {
00007 
00008 bool NodeAtTimeKey::operator==( const NodeAtTimeKey& v ) const
00009 {
00010         return
00011                 ( v._name == _name ) &&
00012                 ( v._time == _time );
00013 }
00014 
00015 bool NodeAtTimeKey::operator<( const NodeAtTimeKey& v ) const
00016 {
00017         if( v._name == _name )
00018         {
00019                 return v._time < _time;
00020         }
00021         return v._name < _name;
00022 }
00023 
00024 std::size_t NodeAtTimeKey::getHash() const
00025 {
00026         std::size_t seed = 0;
00027         boost::hash_combine( seed, _name );
00028         boost::hash_combine( seed, _time );
00029         return seed;
00030 }
00031 
00032 std::ostream& operator<<( std::ostream& os, const NodeAtTimeKey& k )
00033 {
00034         os << "(" << k._name << ", " << k._time << ")";
00035         return os;
00036 }
00037 
00038 }
00039 }