Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Addr.h
blob22a614eb3142b299c92c19fad8dcd9e1f91720a2
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Addr.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef ACE_ADDR_H
12 #define ACE_ADDR_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
25 * @class ACE_Addr
27 * @brief Defines the base class for the "address family independent"
28 * address format.
30 class ACE_Export ACE_Addr
32 public:
33 /// Initializes instance variables.
34 ACE_Addr (int type = -1, int size = -1);
36 /// Destructor.
37 virtual ~ACE_Addr () = default;
39 // = Get/set the size of the address.
41 /// Return the size of the address.
42 int get_size () const;
44 /// Sets the size of the address.
45 void set_size (int size);
47 // = Get/set the type of the address.
49 /// Get the type of the address.
50 int get_type () const;
52 /// Set the type of the address.
53 void set_type (int type);
55 /// Return a pointer to the address.
56 virtual void *get_addr () const;
58 /// Set a pointer to the address.
59 virtual void set_addr (const void *, int len);
61 // = Equality/inequality tests
62 /// Check for address equality.
63 bool operator == (const ACE_Addr &sap) const;
65 /// Check for address inequality.
66 bool operator != (const ACE_Addr &sap) const;
68 /// Initializes instance variables.
69 void base_set (int type, int size);
71 /// Wild-card address.
72 static const ACE_Addr sap_any;
74 /// Returns a hash value. This should be overwritten by a subclass
75 /// that can produce a better hash value.
76 virtual unsigned long hash () const;
78 /// Dump the state of an object.
79 void dump () const;
81 /// Declare the dynamic allocation hooks.
82 ACE_ALLOC_HOOK_DECLARE;
84 protected:
85 /// e.g., AF_UNIX, AF_INET, AF_SPIPE, etc.
86 int addr_type_;
88 /// Number of bytes in the address.
89 int addr_size_;
92 ACE_END_VERSIONED_NAMESPACE_DECL
94 #if defined (__ACE_INLINE__)
95 #include "ace/Addr.inl"
96 #endif /* __ACE_INLINE__ */
98 #include /**/ "ace/post.h"
100 #endif /* ACE_ADDR_H */