Hello,
I've got the following data structure:
struct Service;
typedef shared_ptr<Service> ServicePtr;
struct Event
{
ServicePtr service() const;
ptime time() const;
};
typedef shared_ptr<Event> EventPtr;
struct Cache
{
struct time_tag{};
typedef mi::multi_index_container<
EventPtr,
mi::indexed_by<
mi::ordered_non_unique<
mi::tag,
mi::composite_key<
EventPtr,
mi::const_mem_fun
mi::const_mem_fun
>
>
>
> type;
typedef type::index::type ByTime;
};
Cache cache_;
ServicePtr servicePtr = ...;
period = ...;
I try to extract all the events belonging to some service and bounded
by "period":
namespace bl=boost::lambda;
pair byPeriod =
cache_.getCache::time_tag().range(bl::_1 >= make_tuple(servicePtr,
period.begin()), bl::_1 <= make_tuple(servicePtr, period.last()));
The cache contains lots of matching events, but for some reason, this
expression always returs empty region, i.e.
byPeriod.first==byPeriod.second.
So I'd like to know if the above expression is correct or I'm doing
something wrong?
Thank you.