zoukankan      html  css  js  c++  java
  • 标志位处理

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

  • 相关阅读:
    MySQL5.7初始密码查看及重置
    ps top kill
    Linux基础知识[2]【延迟及定时机制】
    大数加减运算
    字符串分隔
    打印NxN的矩阵
    交叉排序
    去除重复字符并排序
    大数求差——(华为实习招聘机试题)
    图解TCP-IP协议
  • 原文地址:https://www.cnblogs.com/youyou/p/238413.html
Copyright © 2011-2022 走看看