Hi,
Here is what I am trying to do
typedef DWORD DSIid;
enum DSType
{
DSTypeNone = 0,
DSTypeBegin,
DSTypeRoot
}
struct SDSIOwnedByKey
{
SDSIOwnedByKey(DSType DSTypeOwned, DSIid DSIidOwned, DSType DSTypeOwner, DSIid DSIidOwner)
: m_DSTypeOwned(DSTypeOwned), m_DSIidOwned(DSIidOwned), m_DSTypeOwner(DSTypeOwner), m_DSIidOwner(DSIidOwner)
{
}
bool operator == (const SDSIOwnedByKey &rcComp) const
{
return m_DSTypeOwned == rcComp.m_DSTypeOwned &&
m_DSIidOwned == rcComp.m_DSIidOwned &&
m_DSTypeOwner == rcComp.m_DSTypeOwner &&
m_DSIidOwner == rcComp.m_DSIidOwner;
}
DSType m_DSTypeOwned;
DSIid m_DSIidOwned;
DSType m_DSTypeOwner;
DSIid m_DSIidOwner;
};
class DataStore
{
typedef boost::multi_index_container<
SDSIOwnedByKey,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<boost::multi_index::tag<ByOwnedTypeOwnerTypeOwnerIdOwnedId>,
boost::multi_index::composite_key<SDSIOwnedByKey,
boost::multi_index::member<SDSIOwnedByKey, DSType, &SDSIOwnedByKey::m_DSTypeOwned>,
boost::multi_index::member<SDSIOwnedByKey, DSType, &SDSIOwnedByKey::m_DSTypeOwner>,
boost::multi_index::member<SDSIOwnedByKey, DSIid, &SDSIOwnedByKey::m_DSIidOwner>,
boost::multi_index::member<SDSIOwnedByKey, DSIid, &SDSIOwnedByKey::m_DSIidOwned>
>, boost::multi_index::composite_key_compare<std::less<DSType>,std::less<DSType>, std::less<DSIid>, std::greater<DSIid>>
>
>
> TOwnedBySort;
typedef typename TOwnedBySort::index<ByOwnedTypeOwnerTypeOwnerIdOwnedId>::type OwnedBySort_ByOwnedTypeOwnerTypeOwnerId;
TOwnedBySort m_oOwnedBySort;
};
Instead of
>, boost::multi_index::composite_key_compare<std::less<DSType>,std::less<DSType>, std::less<DSIid>, std::greater<DSIid>>
I want to write a compare function that compared all the values in one function, like a complete record comparison something like
>, boost::multi_index::composite_key_compare<SDSIOwnedByKey>
And have an appropriate function which would get the whole record to compare
Thanks
Brijesh