summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchatty2000-11-28 17:07:44 +0000
committerchatty2000-11-28 17:07:44 +0000
commitc34b4aa9b8af7b4a0c98e7a6760fdb5f7370074a (patch)
tree6e9dc34153f0e7a1cc788dbcde03e107cecee269
parentcd2355d463b194d1b7ed86487239d16e4a0babfa (diff)
downloadivy-league-c34b4aa9b8af7b4a0c98e7a6760fdb5f7370074a.zip
ivy-league-c34b4aa9b8af7b4a0c98e7a6760fdb5f7370074a.tar.gz
ivy-league-c34b4aa9b8af7b4a0c98e7a6760fdb5f7370074a.tar.bz2
ivy-league-c34b4aa9b8af7b4a0c98e7a6760fdb5f7370074a.tar.xz
* Removed smart pointers (S.Sire)
* Changed UchInetAddress::StrRepr and added GetHostname and GetNoHostname
-rw-r--r--comm/Address.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/comm/Address.h b/comm/Address.h
index 70df60b..d0e083d 100644
--- a/comm/Address.h
+++ b/comm/Address.h
@@ -3,7 +3,7 @@
*
* by Michel Beaudouin-Lafon
*
- * Copyright 1990-1993
+ * Copyright 1990-1997
* Laboratoire de Recherche en Informatique (LRI)
*
* Addresses
@@ -16,8 +16,9 @@
#define Address_H_
#include "cplus_bugs.h"
-#include "global.h"
-#include "ccu/SmartPointer.h"
+#include "ccu/bool.h"
+#include "ccu/word.h"
+#include "ccu/String.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -43,14 +44,13 @@ typedef struct sockaddr SockAddr;
/* this union is useful for adresses returned by system calls */
typedef union gen_addr GEN_ADDR;
-
-class UchAddress : public CcuSmartData {
+class UchAddress {
protected:
bool Valid;
public:
UchAddress ();
- ~UchAddress ();
+virtual ~UchAddress ();
bool IsValid () const { return Valid; }
virtual int Family () = 0; // AF_UNSPEC, AF_UNIX, AF_INET
@@ -61,12 +61,14 @@ virtual char* StrRepr (char* buf) = 0;
static UchAddress* Decode (GEN_ADDR*, int);
};
-PointerClass (pUchAddress, UchAddress)
-
class UchInetAddress : public UchAddress {
protected:
+ CcuString HostName;
+ bool HasHostName;
struct sockaddr_in Addr;
+ const char* GetNoHostName ();
+
public:
UchInetAddress ();
UchInetAddress (lword, sword); // hostid, port#
@@ -78,7 +80,8 @@ public:
SockAddr* GetSockAddr ();
inline sword Port () { return Addr.sin_port; }
inline lword Host () { return Addr.sin_addr.s_addr; }
- char* StrRepr (char* buf);
+ char* StrRepr (char* buf = 0);
+ const char* GetHostName ();
static lword LoopBack ();
};
@@ -92,7 +95,6 @@ static lword LoopBack ();
#define BROADCAST ((lword) INADDR_BROADCAST)
-
#ifdef UNIX_SOCK
class UchUnixAddress : public UchAddress {
@@ -114,4 +116,3 @@ public:
#endif /* Address_H_ */
-