libDwm-0.9.45
Dwm::Ipv6AddrMap< T, Hash > Class Template Reference

A thin wrapper around std::unordered_map<Ipv6Address,T,Hash>. More...

#include <DwmIpv6AddrMap.hh>

Public Member Functions

void Add (const Ipv6Address &addr, const T &value)
 
void Add (std::unique_lock< std::shared_mutex > &lck, const Ipv6Address &addr, const T &value)
 
bool Find (const Ipv6Address &addr, T &value) const
 
bool Find (std::shared_lock< std::shared_mutex > &lck, const Ipv6Address &addr, T &value) const
 
bool Find (std::unique_lock< std::shared_mutex > &lck, const Ipv6Address &addr, T &value) const
 
bool Remove (const Ipv6Address &addr)
 
bool Remove (std::unique_lock< std::shared_mutex > &lck, const Ipv6Address &addr)
 
bool Empty () const
 
bool Empty (std::shared_lock< std::shared_mutex > &lck) const
 
bool Empty (std::unique_lock< std::shared_mutex > &lck) const
 
void Clear ()
 
void Clear (std::unique_lock< std::shared_mutex > &lck)
 
std::istream & Read (std::istream &is)
 Reads the Ipv6AddrMap from an istream. Returns the istream.
 
std::ostream & Write (std::ostream &os) const
 Writes the Ipv6AddrMap to an ostream. Returns the ostream.
 
size_t Read (FILE *f)
 Reads the Ipv6AddrMap from f.
 
size_t Write (FILE *f) const
 Writes the Ipv6AddrMap to f.
 
ssize_t Read (int fd)
 Reads the Ipv6AddrMap from file descriptor fd.
 
ssize_t Write (int fd) const
 Writes the Ipv6AddrMap to file descriptor fd.
 
int Read (gzFile gzf)
 Reads the Ipv6AddrMap from gzf.
 
int Write (gzFile gzf) const
 Writes the Ipv6AddrMap to gzf.
 
int BZRead (BZFILE *bzf)
 Reads the Ipv6AddrMap from bzf.
 
int BZWrite (BZFILE *bzf) const
 Writes the Ipv6AddrMap to bzf.
 
uint64_t StreamedLength () const
 Returns the number of bytes that would be written if the Ipv6AddrMap was written to a FILE, file descriptor or ostream.
 
bool Read (boost::asio::ip::tcp::socket &s, boost::system::error_code &ec)
 Reads the Ipv6AddrMap from s.
 
bool Write (boost::asio::ip::tcp::socket &s, boost::system::error_code &ec) const
 Writes the Ipv6AddrMap to s.
 
bool Read (boost::asio::local::stream_protocol::socket &s, boost::system::error_code &ec)
 Reads the Ipv6AddrMap from s.
 
bool Write (boost::asio::local::stream_protocol::socket &s, boost::system::error_code &ec) const
 Writes the Ipv6AddrMap to s.
 
bool Read (boost::asio::generic::stream_protocol::socket &s, boost::system::error_code &ec)
 Reads the Ipv6AddrMap from s.
 
bool Write (boost::asio::generic::stream_protocol::socket &s, boost::system::error_code &ec) const
 Writes the Ipv6AddrMap to s.
 
std::shared_lock< std::shared_mutex > SharedLock () const
 
std::unique_lock< std::shared_mutex > UniqueLock ()
 

Detailed Description

template<typename T, typename Hash = OurIpv6AddressHash>
class Dwm::Ipv6AddrMap< T, Hash >

A thin wrapper around std::unordered_map<Ipv6Address,T,Hash>.

Mainly provides thread safety (shared and unique locks).

Member Function Documentation

◆ BZRead()

template<typename T , typename Hash = OurIpv6AddressHash>
int Dwm::Ipv6AddrMap< T, Hash >::BZRead ( BZFILE * bzf)
inline

Reads the Ipv6AddrMap from bzf.

Returns the number of bytes read on success, -1 on failure. Be wary; the integer return is risky (could overflow) but it's what bzlib's BZ2_bzRead() returns and we trickled up the return type.

Here is the call graph for this function:

◆ BZWrite()

template<typename T , typename Hash = OurIpv6AddressHash>
int Dwm::Ipv6AddrMap< T, Hash >::BZWrite ( BZFILE * bzf) const
inline

Writes the Ipv6AddrMap to bzf.

Returns the number of bytes written on success, -1 on failure. Be wary; the integer return is risky (could overflow) but it's what bzlib's BZ2_bzWrite() returns and we trickled up the return type.

Here is the call graph for this function:

◆ Read() [1/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Read ( boost::asio::generic::stream_protocol::socket & s,
boost::system::error_code & ec )
inline

Reads the Ipv6AddrMap from s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Read() [2/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Read ( boost::asio::ip::tcp::socket & s,
boost::system::error_code & ec )
inline

Reads the Ipv6AddrMap from s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Read() [3/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Read ( boost::asio::local::stream_protocol::socket & s,
boost::system::error_code & ec )
inline

Reads the Ipv6AddrMap from s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Read() [4/6]

template<typename T , typename Hash = OurIpv6AddressHash>
size_t Dwm::Ipv6AddrMap< T, Hash >::Read ( FILE * f)
inline

Reads the Ipv6AddrMap from f.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Read() [5/6]

template<typename T , typename Hash = OurIpv6AddressHash>
int Dwm::Ipv6AddrMap< T, Hash >::Read ( gzFile gzf)
inline

Reads the Ipv6AddrMap from gzf.

Returns the number of bytes read on success, -1 on failure. Be wary; the integer return is risky (could overflow) but it's what zlib's gzread() returns and we trickled up the return type.

Here is the call graph for this function:

◆ Read() [6/6]

template<typename T , typename Hash = OurIpv6AddressHash>
ssize_t Dwm::Ipv6AddrMap< T, Hash >::Read ( int fd)
inline

Reads the Ipv6AddrMap from file descriptor fd.

Returns the number of bytes read on success, -1 on failure.

Here is the call graph for this function:

◆ Write() [1/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Write ( boost::asio::generic::stream_protocol::socket & s,
boost::system::error_code & ec ) const
inline

Writes the Ipv6AddrMap to s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Write() [2/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Write ( boost::asio::ip::tcp::socket & s,
boost::system::error_code & ec ) const
inline

Writes the Ipv6AddrMap to s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Write() [3/6]

template<typename T , typename Hash = OurIpv6AddressHash>
bool Dwm::Ipv6AddrMap< T, Hash >::Write ( boost::asio::local::stream_protocol::socket & s,
boost::system::error_code & ec ) const
inline

Writes the Ipv6AddrMap to s.

Returns true on success, false on failure.

Here is the call graph for this function:

◆ Write() [4/6]

template<typename T , typename Hash = OurIpv6AddressHash>
size_t Dwm::Ipv6AddrMap< T, Hash >::Write ( FILE * f) const
inline

Writes the Ipv6AddrMap to f.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Write() [5/6]

template<typename T , typename Hash = OurIpv6AddressHash>
int Dwm::Ipv6AddrMap< T, Hash >::Write ( gzFile gzf) const
inline

Writes the Ipv6AddrMap to gzf.

Returns the number of bytes written on success, -1 on failure. Be wary; the integer return is risky (could overflow) but it's what zlib's gzwrite() returns and we trickled up the return type.

Here is the call graph for this function:

◆ Write() [6/6]

template<typename T , typename Hash = OurIpv6AddressHash>
ssize_t Dwm::Ipv6AddrMap< T, Hash >::Write ( int fd) const
inline

Writes the Ipv6AddrMap to file descriptor fd.

Returns the number of bytes written on success, -1 on failure.

Here is the call graph for this function:

The documentation for this class was generated from the following file: