libassa  3.5.1
UNIXAddress.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // UNIXAddress.h
4 //------------------------------------------------------------------------------
5 // Copyright (c) 1999 by Vladislav Grinchenko
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //------------------------------------------------------------------------------
12 // Created: 03/22/99
13 //------------------------------------------------------------------------------
14 #ifndef UNIX_ADDRESS_H
15 #define UNIX_ADDRESS_H
16 
17 #if !defined(WIN32)
18 
19 #include "assa/Address.h"
20 
21 namespace ASSA {
22 
28 class UNIXAddress : public Address {
29 public:
33  UNIXAddress (const char * socket_name_);
34 
38  UNIXAddress (SA* socket_address_);
39 
41  virtual ~UNIXAddress ();
42 
44  const int getLength () const;
45 
47  SA* getAddress () const;
48 
49 private:
52 };
53 
54 inline
56 ~UNIXAddress () { trace("UNIXAddress::~UNIXAddress"); }
57 
58 inline const int
60 getLength () const { return sizeof (m_address); }
61 
62 inline SA*
64 getAddress () const { return (SA*) &m_address; }
65 
66 } // end namespace ASSA
67 
68 #endif /* !defined WIN32 */
69 
70 #endif /* UNIX_ADDRESS_H */
Address is an abstraction for INET or UNIX-domain address data type.
#define trace(s)
trace() is used to trace function call chain in C++ program.
Definition: Logger.h:429
const int getLength() const
Retrieve address length.
Definition: UNIXAddress.h:60
SA * getAddress() const
Retrieve underlying address structure.
Definition: UNIXAddress.h:64
SA_UN m_address
UNIX socket address structure.
Definition: UNIXAddress.h:51
virtual ~UNIXAddress()
Destructor.
Definition: UNIXAddress.h:56
UNIXAddress(const char *socket_name_)
Constructor.
Definition: UNIXAddress.cpp:22
Definition: Acceptor.h:40
struct sockaddr_un SA_UN
Definition: Address.h:44
struct sockaddr SA
Definition: Address.h:33