BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
422825a
Branches
Tags
master
Blinker
src
linux
Udp4Addr.h
implement all comparison operators for UDPv4 address
Stefan Schuermans
commited
422825a
at 2011-12-21 22:46:46
Udp4Addr.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef UDP4ADDR_H #define UDP4ADDR_H #include <netinet/in.h> #include <string> #include <sys/socket.h> #include <sys/types.h> #include "Addr.h" namespace Blinker { /// UDP v4 address class Udp4Addr: public Addr { public: /// constructor Udp4Addr(); /// virtual destructor virtual ~Udp4Addr(); public: /// comparison //@{ int compare(const Udp4Addr &that) const; bool operator==(const Udp4Addr &that) const; bool operator!=(const Udp4Addr &that) const; bool operator<(const Udp4Addr &that) const; bool operator>(const Udp4Addr &that) const; bool operator<=(const Udp4Addr &that) const; bool operator>=(const Udp4Addr &that) const; //@} /// return address family virtual int getFamily() const; /** * @brief parse from string format * @param[in] str string format * @return if parsing was successful */ virtual bool fromStr(const std::string &str); /** * @brief convert to string format * @return string format */ virtual std::string toStr() const; protected: struct sockaddr_in m_addr; friend class Udp4Sock; }; // class Udp4Addr } // namespace Blinker #endif // #ifndef UDP4ADDR_H