File: UNIXAddress.h

package info (click to toggle)
libassa 3.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,268 kB
  • sloc: cpp: 15,703; sh: 12,083; makefile: 379; perl: 51
file content (70 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// -*- c++ -*-
//------------------------------------------------------------------------------
//                             UNIXAddress.h
//------------------------------------------------------------------------------
//  Copyright (c) 1999 by Vladislav Grinchenko
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Library General Public
//  License as published by the Free Software Foundation; either
//  version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
//  Created: 03/22/99
//------------------------------------------------------------------------------
#ifndef UNIX_ADDRESS_H
#define UNIX_ADDRESS_H

#if !defined(WIN32)

#include "assa/Address.h"

namespace ASSA {

/** @file UNIXAddress.h 
 *
 * UNIXAddress encapsulates UNIX domain socket address structure.
 */

class UNIXAddress : public Address {
public:
	/** Constructor.
	 * @param socket_name_ UNIX path name
	 */
	UNIXAddress (const char * socket_name_);

	/** Copy constructor.
	 * @param socket_address_ address to copy from
	 */
	UNIXAddress (SA* socket_address_);

	/// Destructor
	virtual ~UNIXAddress ();

	/// Retrieve address length
	const int getLength () const;

	/// Retrieve underlying address structure
	SA* getAddress () const;
	
private:
	/// UNIX socket address structure
	SA_UN m_address;
};

inline
UNIXAddress::
~UNIXAddress () { trace("UNIXAddress::~UNIXAddress"); }

inline const int 
UNIXAddress::
getLength () const { return sizeof (m_address); }

inline SA* 
UNIXAddress::
getAddress () const { return (SA*) &m_address; }

} // end namespace ASSA

#endif  /* !defined WIN32 */
   
#endif /* UNIX_ADDRESS_H */