diff options
Diffstat (limited to 'apps/Gateway')
-rw-r--r-- | apps/Gateway/Gateway/Concrete_Connection_Handlers.h | 12 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Config_Files.h | 14 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Connection_Handler.h | 21 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Connection_Handler_Acceptor.h | 19 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Connection_Handler_Connector.h | 17 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Consumer_Dispatch_Set.h | 12 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Event.h | 26 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Event_Channel.h | 22 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Event_Forwarding_Discriminator.h | 13 | ||||
-rw-r--r-- | apps/Gateway/Gateway/File_Parser.h | 24 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Gateway.h | 12 | ||||
-rw-r--r-- | apps/Gateway/Gateway/Options.h | 6 | ||||
-rw-r--r-- | apps/Gateway/Peer/Options.h | 2 | ||||
-rw-r--r-- | apps/Gateway/Peer/Peer.h | 7 |
14 files changed, 126 insertions, 81 deletions
diff --git a/apps/Gateway/Gateway/Concrete_Connection_Handlers.h b/apps/Gateway/Gateway/Concrete_Connection_Handlers.h index ca36e3f517e..b149856de05 100644 --- a/apps/Gateway/Gateway/Concrete_Connection_Handlers.h +++ b/apps/Gateway/Gateway/Concrete_Connection_Handlers.h @@ -5,7 +5,7 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Concrete_Connection_Handlers.h // @@ -14,11 +14,11 @@ // appropriate threaded/reactive Consumer/Supplier behavior. // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (CONCRETE_CONNECTION_HANDLER) +#ifndef CONCRETE_CONNECTION_HANDLER #define CONCRETE_CONNECTION_HANDLER #include "Connection_Handler.h" @@ -69,8 +69,8 @@ public: // = Initialization method. Consumer_Handler (const Connection_Config_Info &); - virtual int put (ACE_Message_Block *event, - ACE_Time_Value * = 0); + virtual int put (ACE_Message_Block *event, + ACE_Time_Value * = 0); // Send an event to a Consumer (may be queued if necessary). protected: diff --git a/apps/Gateway/Gateway/Config_Files.h b/apps/Gateway/Gateway/Config_Files.h index 1e23006ddbd..9fd96b687f6 100644 --- a/apps/Gateway/Gateway/Config_Files.h +++ b/apps/Gateway/Gateway/Config_Files.h @@ -5,16 +5,16 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Config_Files.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_CONFIG_FILES) +#ifndef _CONFIG_FILES #define _CONFIG_FILES #include "File_Parser.h" @@ -42,7 +42,7 @@ public: ACE_INT32 max_retry_timeout_; // Maximum amount of time to wait for reconnecting. - + u_short local_port_; // Our local port number. @@ -80,10 +80,10 @@ public: ACE_INT32 consumers_[MAX_CONSUMERS]; // Connection ids for consumers that will be routed information // containing this <connection_id_> - + ACE_INT32 total_consumers_; // Total number of these consumers. -}; +}; class Consumer_Config_File_Parser : public File_Parser<Consumer_Config_Info> // = TITLE diff --git a/apps/Gateway/Gateway/Connection_Handler.h b/apps/Gateway/Gateway/Connection_Handler.h index 876f69d97f4..3003a81874e 100644 --- a/apps/Gateway/Gateway/Connection_Handler.h +++ b/apps/Gateway/Gateway/Connection_Handler.h @@ -5,19 +5,24 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Connection_Handler.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_CONNECTION_HANDLER) +#ifndef _CONNECTION_HANDLER #define _CONNECTION_HANDLER #include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/SOCK_Connector.h" #include "ace/Svc_Handler.h" #include "Config_Files.h" @@ -54,7 +59,7 @@ public: CONNECTING, // During connection establishment. ESTABLISHED, // Connection_Handler is established and active. DISCONNECTING, // Connection_Handler is in the process of connecting. - FAILED // Connection_Handler has failed. + FAILED // Connection_Handler has failed. }; // = Set/get the current state. @@ -86,7 +91,7 @@ public: void connection_role (char); char connection_role (void) const; - // = Set/get the <Event_Channel> *. + // = Set/get the <Event_Channel> *. void event_channel (Event_Channel *); Event_Channel *event_channel (void) const; @@ -100,7 +105,7 @@ public: // Perform timer-based Connection_Handler reconnection. virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); + ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); // Perform Connection_Handler termination. protected: @@ -110,7 +115,7 @@ protected: ACE_INET_Addr local_addr_; // Address of us. - CONNECTION_ID connection_id_; + CONNECTION_ID connection_id_; // The assigned connection ID of this entry. size_t total_bytes_; diff --git a/apps/Gateway/Gateway/Connection_Handler_Acceptor.h b/apps/Gateway/Gateway/Connection_Handler_Acceptor.h index fb8d84ad667..777f58c4a5b 100644 --- a/apps/Gateway/Gateway/Connection_Handler_Acceptor.h +++ b/apps/Gateway/Gateway/Connection_Handler_Acceptor.h @@ -5,19 +5,24 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Connection_Handler_acceptor.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_CONNECTION_HANDLER_ACCEPTOR) +#ifndef _CONNECTION_HANDLER_ACCEPTOR #define _CONNECTION_HANDLER_ACCEPTOR #include "ace/Acceptor.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/SOCK_Acceptor.h" #include "Connection_Handler.h" @@ -31,7 +36,7 @@ class Connection_Handler_Acceptor : public ACE_Acceptor<Connection_Handler, ACE_ // and produces a new Connection_Handler object to do the dirty // work... public: - Connection_Handler_Acceptor (Event_Channel &, + Connection_Handler_Acceptor (Event_Channel &, char connection_role); // Constructor. @@ -42,14 +47,14 @@ public: // Hook method for accepting a connection into the // <Connection_Handler>. -protected: +protected: typedef ACE_Acceptor<Connection_Handler, ACE_SOCK_ACCEPTOR> inherited; // Make life easier later on. Event_Channel &event_channel_; // Reference to the event channel. - + Connection_Config_Info connection_config_info_; // Keeps track of what type of proxy we need to create. diff --git a/apps/Gateway/Gateway/Connection_Handler_Connector.h b/apps/Gateway/Gateway/Connection_Handler_Connector.h index e81d66d9694..f4e7d7d06a1 100644 --- a/apps/Gateway/Gateway/Connection_Handler_Connector.h +++ b/apps/Gateway/Gateway/Connection_Handler_Connector.h @@ -5,19 +5,24 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Connection_Handler_Connector.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_IO_HANDLER_CONNECTOR) +#ifndef _IO_HANDLER_CONNECTOR #define _IO_HANDLER_CONNECTOR #include "ace/Connector.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/SOCK_Connector.h" #include "Connection_Handler.h" @@ -31,8 +36,8 @@ public: Connection_Handler_Connector (void); // Initiate (or reinitiate) a connection on the Connection_Handler. - int initiate_connection (Connection_Handler *, - ACE_Synch_Options & = ACE_Synch_Options::synch); + int initiate_connection (Connection_Handler *, + ACE_Synch_Options & = ACE_Synch_Options::synch); }; diff --git a/apps/Gateway/Gateway/Consumer_Dispatch_Set.h b/apps/Gateway/Gateway/Consumer_Dispatch_Set.h index 2f89143460d..3a5d0cf3e25 100644 --- a/apps/Gateway/Gateway/Consumer_Dispatch_Set.h +++ b/apps/Gateway/Gateway/Consumer_Dispatch_Set.h @@ -5,20 +5,24 @@ // // = LIBRARY // apps -// +// // = FILENAME // Consumer_Dispatch_Set.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (CONSUMER_DISPATCH_SET) +#ifndef CONSUMER_DISPATCH_SET #define CONSUMER_DISPATCH_SET #include "ace/Containers.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + // Forward reference. class Connection_Handler; diff --git a/apps/Gateway/Gateway/Event.h b/apps/Gateway/Gateway/Event.h index 2221f63916a..80413bb5a75 100644 --- a/apps/Gateway/Gateway/Event.h +++ b/apps/Gateway/Gateway/Event.h @@ -5,20 +5,24 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Event.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (EVENT_H) +#ifndef EVENT_H #define EVENT_H #include "ace/OS.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + // = The following #defines should really be in a separate include // file that is shared with the ../Peer/ directory. For now, we'll // keep them here to simplify the sharing between the two directories. @@ -45,7 +49,7 @@ #endif /* DEFAULT_PEER_SUPPLIER_PORT */ #if !defined (MAX_CONSUMERS) -#define MAX_CONSUMERS 1000 +#define MAX_CONSUMERS 1000 #endif /* MAX_CONSUMERS */ // This is the unique supplier identifier that denotes a particular @@ -76,10 +80,10 @@ class Event_Key // <connection_id_> and <type_> fields are copied from the // <Event_Header> class below. public: - Event_Key (CONNECTION_ID cid = -1, + Event_Key (CONNECTION_ID cid = -1, ACE_INT32 type = 0, ACE_INT32 priority = 0) - : connection_id_ (cid), + : connection_id_ (cid), type_ (type), priority_ (priority) { @@ -87,7 +91,7 @@ public: int operator== (const Event_Key &event_addr) const { - return this->connection_id_ == event_addr.connection_id_ + return this->connection_id_ == event_addr.connection_id_ && this->type_ == event_addr.type_; } @@ -187,7 +191,7 @@ public: for (ACE_INT32 i = 0; i < this->total_consumers_; i++) this->consumers_[i] = ntohl (this->consumers_[i]); - + this->total_consumers_ = ntohl (this->total_consumers_); } // Decode from network byte order to host byte order. @@ -198,7 +202,7 @@ public: for (ACE_INT32 i = 0; i < this->total_consumers_; i++) this->consumers_[i] = htonl (this->consumers_[i]); - + this->total_consumers_ = htonl (this->total_consumers_); } // Encode from host byte order to network byte order. @@ -209,7 +213,7 @@ public: ACE_INT32 consumers_[MAX_CONSUMERS]; // Connection ids for consumers that will be routed information // containing this <connection_id_> - + ACE_INT32 total_consumers_; // Total number of these consumers. }; diff --git a/apps/Gateway/Gateway/Event_Channel.h b/apps/Gateway/Gateway/Event_Channel.h index dfe5faa6fd4..4dcb86d24d3 100644 --- a/apps/Gateway/Gateway/Event_Channel.h +++ b/apps/Gateway/Gateway/Event_Channel.h @@ -5,16 +5,16 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Event_Channel.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (ACE_EVENT_CHANNEL) +#ifndef ACE_EVENT_CHANNEL #define ACE_EVENT_CHANNEL #include "Connection_Handler_Connector.h" @@ -64,8 +64,8 @@ public: Connection_Handler *&); // Locate the <Connection_Handler> with <connection_id>. - int subscribe (const Event_Key &event_addr, - Consumer_Dispatch_Set *cds); + int subscribe (const Event_Key &event_addr, + Consumer_Dispatch_Set *cds); // Subscribe the <Consumer_Dispatch_Set> to receive events that // match <Event_Key>. @@ -97,8 +97,8 @@ private: int compute_performance_statistics (void); // Perform timer-based performance profiling. - virtual int handle_timeout (const ACE_Time_Value &, - const void *arg); + virtual int handle_timeout (const ACE_Time_Value &, + const void *arg); // Periodically callback to perform timer-based performance // profiling. @@ -112,11 +112,11 @@ private: // Used to establish connections passively and create Consumers. // = Make life easier by defining typedefs. - typedef ACE_Map_Manager<CONNECTION_ID, Connection_Handler *, MAP_MUTEX> + typedef ACE_Map_Manager<CONNECTION_ID, Connection_Handler *, MAP_MUTEX> CONNECTION_MAP; - typedef ACE_Map_Iterator<CONNECTION_ID, Connection_Handler *, MAP_MUTEX> + typedef ACE_Map_Iterator<CONNECTION_ID, Connection_Handler *, MAP_MUTEX> CONNECTION_MAP_ITERATOR; - typedef ACE_Map_Entry<CONNECTION_ID, Connection_Handler *> + typedef ACE_Map_Entry<CONNECTION_ID, Connection_Handler *> CONNECTION_MAP_ENTRY; CONNECTION_MAP connection_map_; diff --git a/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h b/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h index 09b62d007d0..10bc4409589 100644 --- a/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h +++ b/apps/Gateway/Gateway/Event_Forwarding_Discriminator.h @@ -5,19 +5,24 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Event_Forwarding_Discriminator.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_CONSUMER_MAP_H) +#ifndef _CONSUMER_MAP_H #define _CONSUMER_MAP_H #include "ace/Map_Manager.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Synch.h" #include "Event.h" #include "Consumer_Dispatch_Set.h" diff --git a/apps/Gateway/Gateway/File_Parser.h b/apps/Gateway/Gateway/File_Parser.h index e32d0948621..a91a8f75827 100644 --- a/apps/Gateway/Gateway/File_Parser.h +++ b/apps/Gateway/Gateway/File_Parser.h @@ -5,31 +5,35 @@ // // = LIBRARY // gateway -// +// // = FILENAME // File_Parser.h // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (_FILE_PARSER) +#ifndef _FILE_PARSER #define _FILE_PARSER #include "ace/OS.h" -class FP +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class FP { // = TITLE // This class serves as a namespace for the <Return_Type>. public: - enum Return_Type - { + enum Return_Type + { EOLINE, EOFILE, - SUCCESS, - COMMENT, + SUCCESS, + COMMENT, DEFAULT, PARSE_ERROR }; @@ -59,7 +63,7 @@ protected: // Read the next integer. FP::Return_Type readword (char buf[]); - // Read the next "word," which is demarcated by <delimiter>s. + // Read the next "word," which is demarcated by <delimiter>s. // // @@ This function is inherently flawed since it doesn't take a // count of the size of <buf>... diff --git a/apps/Gateway/Gateway/Gateway.h b/apps/Gateway/Gateway/Gateway.h index 5c85f6e696c..56f68644c39 100644 --- a/apps/Gateway/Gateway/Gateway.h +++ b/apps/Gateway/Gateway/Gateway.h @@ -5,7 +5,7 @@ // // = LIBRARY // gateway -// +// // = FILENAME // Gateway.h // @@ -14,15 +14,19 @@ // the entry point into the Service Configurator framework. // // = AUTHOR -// Doug Schmidt -// +// Doug Schmidt +// // ============================================================================ -#if !defined (ACE_GATEWAY) +#ifndef ACE_GATEWAY #define ACE_GATEWAY #include "ace/OS.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_SVC_FACTORY_DECLARE (Gateway) #endif /* ACE_GATEWAY */ diff --git a/apps/Gateway/Gateway/Options.h b/apps/Gateway/Gateway/Options.h index da61b8202c3..b3da9174a9b 100644 --- a/apps/Gateway/Gateway/Options.h +++ b/apps/Gateway/Gateway/Options.h @@ -14,11 +14,15 @@ // // ============================================================================ -#if !defined (OPTIONS_H) +#ifndef OPTIONS_H #define OPTIONS_H #include "ace/Synch.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + class ACE_Svc_Export Options { // = TITLE diff --git a/apps/Gateway/Peer/Options.h b/apps/Gateway/Peer/Options.h index c957e1a295e..dc3daf5ce4b 100644 --- a/apps/Gateway/Peer/Options.h +++ b/apps/Gateway/Peer/Options.h @@ -14,7 +14,7 @@ // // ============================================================================ -#if !defined (OPTIONS_H) +#ifndef OPTIONS_H #define OPTIONS_H #include "../Gateway/Event.h" diff --git a/apps/Gateway/Peer/Peer.h b/apps/Gateway/Peer/Peer.h index 2c67bc1f39d..8a48de1c9a7 100644 --- a/apps/Gateway/Peer/Peer.h +++ b/apps/Gateway/Peer/Peer.h @@ -45,10 +45,15 @@ // // ============================================================================ -#if !defined (PEER_H) +#ifndef PEER_H #define PEER_H #include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Acceptor.h" #include "ace/Connector.h" #include "ace/SOCK_Acceptor.h" |