标志位处理

// flags indicating specified attributes
long m_spflags;
void set_specified(int ind) {m_spflags |= ind;}
enum { SP_DUR = 1, SP_BEGIN = SP_DUR << 1, SP_END = SP_BEGIN << 1, SP_RDUR = SP_END << 1,
 SP_RCOUNT = SP_RDUR << 1, SP_MIN = SP_RCOUNT << 1, SP_MAX = SP_MIN << 1,
 SP_ENDSYNC = SP_MAX << 1, SP_FILL = SP_ENDSYNC << 1, SP_RESTART = SP_FILL << 1};

bool specified_dur() const { return (m_spflags & SP_DUR) == SP_DUR;}
bool specified_begin() const { return (m_spflags & SP_BEGIN) == SP_BEGIN;}
bool specified_end() const { return (m_spflags & SP_END) == SP_END;}
bool specified_rdur() const { return (m_spflags & SP_RDUR) == SP_RDUR;}
bool specified_rcount() const { return (m_spflags & SP_RCOUNT) == SP_RCOUNT;}
bool specified_min() const { return (m_spflags & SP_MIN) == SP_MIN;}
bool specified_max() const { return (m_spflags & SP_MAX) == SP_MAX;}
bool specified_endsync() const { return (m_spflags & SP_ENDSYNC) == SP_ENDSYNC;}
bool specified_fill() const { return (m_spflags & SP_FILL) == SP_FILL;}
bool specified_restart() const { return (m_spflags & SP_RESTART) == SP_RESTART;}

原文地址:https://www.cnblogs.com/youyou/p/238413.html