Rudiments
serviceentry.h
1 // Copyright (c) 2003 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SERVICEENTRY_H
5 #define RUDIMENTS_SERVICEENTRY_H
6 
7 #include <rudiments/private/serviceentryincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class serviceentryprivate;
14 
17 class RUDIMENTS_DLLSPEC serviceentry {
18  public:
19 
26  static bool getAliasList(const char *servicename,
27  const char *protocol,
28  char ***aliaslist);
29 
32  static bool getPort(const char *servicename,
33  const char *protocol,
34  int32_t *port);
35 
40  static bool getName(int32_t port,
41  const char *protocol,
42  char **name);
43 
51  static bool getAliasList(int32_t port,
52  const char *protocol,
53  char ***aliaslist);
54 
55 
57  serviceentry();
58 
61  serviceentry(const serviceentry &s);
62 
65  serviceentry &operator=(const serviceentry &s);
66 
68  ~serviceentry();
69 
73  bool initialize(const char *servicename,
74  const char *protocol);
75 
80  bool initialize(int32_t port, const char *protocol);
81 
83  const char *getName() const;
84 
87  int32_t getPort() const;
88 
91  const char *getProtocol() const;
92 
95  const char * const * getAliasList() const;
96 
98  void print() const;
99 
102  static bool needsMutex();
103 
107  static void setMutex(mutex *mtx);
108 
109  #include <rudiments/private/serviceentry.h>
110 };
111 
112 #ifdef RUDIMENTS_NAMESPACE
113 }
114 #endif
115 
116 #endif