[Home]BoostSocket/SocketOptionConcept

BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List

SocketOption concept

A SocketOption? would wrap the arguments to possible get/setsockopt calls.

e.g.

    template <int LevelValue?, int OptionValue?, bool CanGet?, bool CanSet?,
              typename ValueType?>
    struct socket_option
    {
      socket_option() {}
      socket_option(const ValueType?& ov)
          : value(ov)
      {}

      BOOST_STATIC_CONSTANT(int, level = LevelValue?);
      BOOST_STATIC_CONSTANT(int, option = OptionValue?);
      BOOST_STATIC_CONSTANT(bool, can_get = CanGet?);
      BOOST_STATIC_CONSTANT(bool, can_set = CanSet?);
      ValueType? value;
      static int size() {return sizeof(ValueType?); }
    };

    typedef socket_option<SOL_SOCKET, SO_ERROR, true, false, bool>
      socket_option_error;


BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List
Edit text of this page | View other revisions
Last edited December 18, 2004 12:25 pm (diff)
Search:
Disclaimer: This site not officially maintained by Boost Developers