• 标志位处理


    // 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;}

  • 相关阅读:
    python标准库&多线程
    filter()函数
    python itertools模块
    lambda()函数
    python 基础学习六:字符串方法总结
    装饰器
    map()函数
    python算法题
    Delphi XE2真的快来了吗?
    如何设计出留住买家的B2C网站
  • 原文地址:https://www.cnblogs.com/youyou/p/238413.html
Copyright © 2020-2023  润新知