Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / apps / drwho / Protocol_Manager.h
blob37978300d4731480d2aba6a97375674f1616466d
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Protocol_Manager.h
7 * @author Douglas C. Schmidt
8 */
9 //=============================================================================
12 #ifndef _PROTOCOL_MANAGER_H
13 #define _PROTOCOL_MANAGER_H
15 #include "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "Options.h"
22 #include "Search_Struct.h"
23 #include "Protocol_Record.h"
25 /**
26 * @class Protocol_Manager
28 * @brief A base class that consolidates friend management functionality
29 * shared by both clients and servers.
31 class Protocol_Manager
33 public:
34 Protocol_Manager ();
35 virtual ~Protocol_Manager ();
37 virtual int encode (char *packet, int &total_bytes) = 0;
38 virtual int decode (char *packet, int &total_bytes) = 0;
40 protected:
41 int total_users;
42 Search_Struct *ss;
44 int friend_count ();
46 Drwho_Node *get_drwho_node (char *host_name, Drwho_Node *&head);
47 int get_total_users ();
48 void increment_total_users (int remote_users = 1);
50 Protocol_Record *get_next_friend ();
51 Protocol_Record *get_each_friend ();
53 virtual Protocol_Record *insert_protocol_info (Protocol_Record &protocol_record) = 0;
56 #endif /* _PROTOCOL_MANAGER_H */