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

  • 相关阅读:
    Linux进程间通信(IPC)
    mq_setattr
    mq_getattr
    mq_unlink
    mq_receive
    mq_send
    mq_close
    POSIX消息队列
    mq_open
    C语言关键字
  • 原文地址:https://www.cnblogs.com/youyou/p/238413.html
Copyright © 2011-2022 走看看