46a47
> #include "base/flags.hh"
66a68,80
> protected:
> typedef short FlagsType;
> typedef ::Flags<FlagsType> Flags;
>
> static const FlagsType PublicRead = 0x003f;
> static const FlagsType PublicWrite = 0x001d;
> static const FlagsType Squashed = 0x0001;
> static const FlagsType Scheduled = 0x0002;
> static const FlagsType AutoDelete = 0x0004;
> static const FlagsType AutoSerialize = 0x0008;
> static const FlagsType IsExitEvent = 0x0010;
> static const FlagsType IsMainQueue = 0x0020;
>
85c99
< short _flags;
---
> Flags flags;
120,128c134,139
< enum Flags {
< None = 0x0,
< Squashed = 0x1,
< Scheduled = 0x2,
< AutoDelete = 0x4,
< AutoSerialize = 0x8,
< IsExitEvent = 0x10,
< IsMainQueue = 0x20
< };
---
> /// Accessor for flags.
> Flags
> getFlags() const
> {
> return flags & PublicRead;
> }
130,132c141,146
< bool getFlags(Flags f) const { return (_flags & f) == f; }
< void setFlags(Flags f) { _flags |= f; }
< void clearFlags(Flags f) { _flags &= ~f; }
---
> Flags
> getFlags(Flags _flags) const
> {
> assert(flags.noneSet(~PublicRead));
> return flags.isSet(_flags);
> }
134c148,175
< protected:
---
> Flags
> allFlags(Flags _flags) const
> {
> assert(_flags.noneSet(~PublicRead));
> return flags.allSet(_flags);
> }
>
> /// Accessor for flags.
> void
> setFlags(Flags _flags)
> {
> assert(_flags.noneSet(~PublicWrite));
> flags.set(_flags);
> }
>
> void
> clearFlags(Flags _flags)
> {
> assert(_flags.noneSet(~PublicWrite));
> flags.clear(_flags);
> }
>
> void
> clearFlags()
> {
> flags.clear(PublicWrite);
> }
>
200c241
< : nextBin(NULL), nextInBin(NULL), _priority(p), _flags(None)
---
> : nextBin(NULL), nextInBin(NULL), _priority(p)
237c278
< bool scheduled() const { return getFlags(Scheduled); }
---
> bool scheduled() const { return flags.isSet(Scheduled); }
240c281
< void squash() { setFlags(Squashed); }
---
> void squash() { flags.set(Squashed); }
243c284
< bool squashed() const { return getFlags(Squashed); }
---
> bool squashed() const { return flags.isSet(Squashed); }
246c287
< bool isExitEvent() const { return getFlags(IsExitEvent); }
---
> bool isExitEvent() const { return flags.isSet(IsExitEvent); }
401c442
< { setFlags(this->AutoDestroy); }
---
> { this->setFlags(AutoDelete); }
434c475
< event->setFlags(Event::Scheduled);
---
> event->flags.set(Event::Scheduled);
436c477
< event->setFlags(Event::IsMainQueue);
---
> event->flags.set(Event::IsMainQueue);
438c479
< event->clearFlags(Event::IsMainQueue);
---
> event->flags.clear(Event::IsMainQueue);
451,452c492,493
< event->clearFlags(Event::Squashed);
< event->clearFlags(Event::Scheduled);
---
> event->flags.clear(Event::Squashed);
> event->flags.clear(Event::Scheduled);
454c495
< if (event->getFlags(Event::AutoDelete))
---
> if (event->flags.isSet(Event::AutoDelete))
472,473c513,514
< event->clearFlags(Event::Squashed);
< event->setFlags(Event::Scheduled);
---
> event->flags.clear(Event::Squashed);
> event->flags.set(Event::Scheduled);
475c516
< event->setFlags(Event::IsMainQueue);
---
> event->flags.set(Event::IsMainQueue);
477c518
< event->clearFlags(Event::IsMainQueue);
---
> event->flags.clear(Event::IsMainQueue);