diff options
author | Marc Laukien <marc@zeroc.com> | 2002-06-24 18:49:27 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-06-24 18:49:27 +0000 |
commit | 1cb9977463f5a832b3f6daea8a2322d38dbba423 (patch) | |
tree | d1ae4045c5fa9a7124201510df3ad5b7211788cb /cpp | |
parent | Added checks to disallow definition of a name in a derived class/interface (diff) | |
download | ice-1cb9977463f5a832b3f6daea8a2322d38dbba423.tar.bz2 ice-1cb9977463f5a832b3f6daea8a2322d38dbba423.tar.xz ice-1cb9977463f5a832b3f6daea8a2322d38dbba423.zip |
unix format
Diffstat (limited to 'cpp')
229 files changed, 16627 insertions, 16627 deletions
diff --git a/cpp/demo/Freeze/library/BookFactory.h b/cpp/demo/Freeze/library/BookFactory.h index 677fc77e3bc..58a95f2d8e5 100644 --- a/cpp/demo/Freeze/library/BookFactory.h +++ b/cpp/demo/Freeze/library/BookFactory.h @@ -1,33 +1,33 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef BOOK_FACTORY_H
-#define BOOK_FACTORY_H
-
-#include <LibraryI.h>
-
-class BookFactory : virtual public Ice::ObjectFactory
-{
-public:
-
- BookFactory(const LibraryIPtr&);
-
- //
- // Operations from ObjectFactory
- //
- virtual Ice::ObjectPtr create(const std::string&);
- virtual void destroy();
-
-private:
-
- LibraryIPtr _library;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef BOOK_FACTORY_H +#define BOOK_FACTORY_H + +#include <LibraryI.h> + +class BookFactory : virtual public Ice::ObjectFactory +{ +public: + + BookFactory(const LibraryIPtr&); + + // + // Operations from ObjectFactory + // + virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); + +private: + + LibraryIPtr _library; +}; + +#endif diff --git a/cpp/demo/Freeze/library/LibraryI.h b/cpp/demo/Freeze/library/LibraryI.h index 3fb81d5f11d..88c18a97a15 100644 --- a/cpp/demo/Freeze/library/LibraryI.h +++ b/cpp/demo/Freeze/library/LibraryI.h @@ -1,66 +1,66 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef LIBRARY_I_H
-#define LIBRARY_I_H
-
-#include <IceUtil/RWRecMutex.h>
-
-#include <Library.h>
-#include <LibraryTypes.h>
-
-class LibraryI : public Library, public IceUtil::RWRecMutex
-{
-public:
-
- LibraryI(const Ice::ObjectAdapterPtr&, const Freeze::DBPtr&, const Freeze::EvictorPtr&);
- virtual ~LibraryI();
-
- virtual ::BookPrx createBook(const ::BookDescription&, const Ice::Current&);
- virtual ::BookPrx findByIsbn(const ::std::string&, const Ice::Current&);
- virtual ::BookPrxSeq findByAuthors(const ::std::string&, const Ice::Current&);
- virtual void setEvictorSize(::Ice::Int, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
- void remove(const BookDescription&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- Freeze::EvictorPtr _evictor;
-
- //
- // This is a dictionary of authors to a sequence of isbn numbers
- // for efficient lookup of books by authors.
- //
- StringIsbnSeqDict _authors;
-};
-
-typedef IceUtil::Handle<LibraryI> LibraryIPtr;
-
-class BookI : public Book, public IceUtil::RWRecMutex
-{
-public:
-
- BookI(const LibraryIPtr&);
- virtual ~BookI();
-
- virtual ::BookDescription getBookDescription(const Ice::Current&);
- virtual void destroy(const Ice::Current&);
- virtual void rentBook(const ::std::string&, const Ice::Current&);
- virtual ::std::string getRenterName(const Ice::Current&);
- virtual void returnBook(const Ice::Current&);
-
-private:
-
- LibraryIPtr _library;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef LIBRARY_I_H +#define LIBRARY_I_H + +#include <IceUtil/RWRecMutex.h> + +#include <Library.h> +#include <LibraryTypes.h> + +class LibraryI : public Library, public IceUtil::RWRecMutex +{ +public: + + LibraryI(const Ice::ObjectAdapterPtr&, const Freeze::DBPtr&, const Freeze::EvictorPtr&); + virtual ~LibraryI(); + + virtual ::BookPrx createBook(const ::BookDescription&, const Ice::Current&); + virtual ::BookPrx findByIsbn(const ::std::string&, const Ice::Current&); + virtual ::BookPrxSeq findByAuthors(const ::std::string&, const Ice::Current&); + virtual void setEvictorSize(::Ice::Int, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + + void remove(const BookDescription&); + +private: + + Ice::ObjectAdapterPtr _adapter; + Freeze::EvictorPtr _evictor; + + // + // This is a dictionary of authors to a sequence of isbn numbers + // for efficient lookup of books by authors. + // + StringIsbnSeqDict _authors; +}; + +typedef IceUtil::Handle<LibraryI> LibraryIPtr; + +class BookI : public Book, public IceUtil::RWRecMutex +{ +public: + + BookI(const LibraryIPtr&); + virtual ~BookI(); + + virtual ::BookDescription getBookDescription(const Ice::Current&); + virtual void destroy(const Ice::Current&); + virtual void rentBook(const ::std::string&, const Ice::Current&); + virtual ::std::string getRenterName(const Ice::Current&); + virtual void returnBook(const Ice::Current&); + +private: + + LibraryIPtr _library; +}; + +#endif diff --git a/cpp/demo/Freeze/library/Parser.h b/cpp/demo/Freeze/library/Parser.h index ed19c1bee69..fa074055cd1 100644 --- a/cpp/demo/Freeze/library/Parser.h +++ b/cpp/demo/Freeze/library/Parser.h @@ -1,106 +1,106 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef PARSER_H
-#define PARSER_H
-
-#include <IceUtil/Handle.h>
-#include <Ice/Ice.h>
-#include <Library.h>
-#include <list>
-
-#ifdef _WIN32
-# include <io.h>
-# define isatty _isatty
-# define fileno _fileno
-// '_isatty' : inconsistent dll linkage. dllexport assumed.
-# pragma warning( disable : 4273 )
-#endif
-
-//
-// Stuff for flex and bison
-//
-
-#define YYSTYPE std::list<std::string>
-#define YY_DECL int yylex(YYSTYPE* yylvalp)
-YY_DECL;
-int yyparse();
-
-//
-// I must set the initial stack depth to the maximum stack depth to
-// disable bison stack resizing. The bison stack resizing routines use
-// simple malloc/alloc/memcpy calls, which do not work for the
-// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
-// assignment operator, etc.
-//
-#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
-#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
-
-//
-// Newer bison versions allow to disable stack resizing by defining
-// yyoverflow.
-//
-#define yyoverflow(a, b, c, d, e, f) yyerror(a)
-
-class Parser;
-typedef ::IceUtil::Handle<Parser> ParserPtr;
-
-class Parser : public ::IceUtil::SimpleShared
-{
-public:
-
- static ParserPtr createParser(const Ice::CommunicatorPtr&, const LibraryPrx&);
-
- void usage();
-
- void addBook(const std::list<std::string>&);
- void findIsbn(const std::list<std::string>&);
- void findAuthors(const std::list<std::string>&);
- void nextFoundBook();
- void printCurrent();
- void rentCurrent(const std::list<std::string>&);
- void returnCurrent();
- void removeCurrent();
- void setEvictorSize(const std::list<std::string>&);
- void shutdown();
-
- void getInput(char*, int&, int);
- void nextLine();
- void continueLine();
- char* getPrompt();
-
- void error(const char*);
- void error(const std::string&);
-
- void warning(const char*);
- void warning(const std::string&);
-
- int parse(FILE*, bool);
- int parse(const std::string&, bool);
-
-private:
-
- Parser(const Ice::CommunicatorPtr&, const LibraryPrx&);
-
- BookPrxSeq _foundBooks;
- BookPrxSeq::iterator _current;
-
- std::string _commands;
- Ice::CommunicatorPtr _communicator;
- LibraryPrx _library;
- bool _continue;
- int _errors;
- int _currentLine;
- std::string _currentFile;
-};
-
-extern Parser* parser; // The current parser for bison/flex
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef PARSER_H +#define PARSER_H + +#include <IceUtil/Handle.h> +#include <Ice/Ice.h> +#include <Library.h> +#include <list> + +#ifdef _WIN32 +# include <io.h> +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. +# pragma warning( disable : 4273 ) +#endif + +// +// Stuff for flex and bison +// + +#define YYSTYPE std::list<std::string> +#define YY_DECL int yylex(YYSTYPE* yylvalp) +YY_DECL; +int yyparse(); + +// +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +// +#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum. +#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. + +// +// Newer bison versions allow to disable stack resizing by defining +// yyoverflow. +// +#define yyoverflow(a, b, c, d, e, f) yyerror(a) + +class Parser; +typedef ::IceUtil::Handle<Parser> ParserPtr; + +class Parser : public ::IceUtil::SimpleShared +{ +public: + + static ParserPtr createParser(const Ice::CommunicatorPtr&, const LibraryPrx&); + + void usage(); + + void addBook(const std::list<std::string>&); + void findIsbn(const std::list<std::string>&); + void findAuthors(const std::list<std::string>&); + void nextFoundBook(); + void printCurrent(); + void rentCurrent(const std::list<std::string>&); + void returnCurrent(); + void removeCurrent(); + void setEvictorSize(const std::list<std::string>&); + void shutdown(); + + void getInput(char*, int&, int); + void nextLine(); + void continueLine(); + char* getPrompt(); + + void error(const char*); + void error(const std::string&); + + void warning(const char*); + void warning(const std::string&); + + int parse(FILE*, bool); + int parse(const std::string&, bool); + +private: + + Parser(const Ice::CommunicatorPtr&, const LibraryPrx&); + + BookPrxSeq _foundBooks; + BookPrxSeq::iterator _current; + + std::string _commands; + Ice::CommunicatorPtr _communicator; + LibraryPrx _library; + bool _continue; + int _errors; + int _currentLine; + std::string _currentFile; +}; + +extern Parser* parser; // The current parser for bison/flex + +#endif diff --git a/cpp/demo/Freeze/library/dummyinclude/unistd.h b/cpp/demo/Freeze/library/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/demo/Freeze/library/dummyinclude/unistd.h +++ b/cpp/demo/Freeze/library/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/demo/Freeze/phonebook/ContactFactory.h b/cpp/demo/Freeze/phonebook/ContactFactory.h index 0cb42282a07..e1def9780b1 100644 --- a/cpp/demo/Freeze/phonebook/ContactFactory.h +++ b/cpp/demo/Freeze/phonebook/ContactFactory.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CONTACT_FACTORY_H
-#define CONTACT_FACTORY_H
-
-#include <PhoneBookI.h>
-
-class ContactFactory : virtual public Ice::ObjectFactory, virtual public Freeze::ServantInitializer
-{
-public:
-
- ContactFactory(const PhoneBookIPtr&, const Freeze::EvictorPtr&);
-
- //
- // Operations from ObjectFactory
- //
- virtual Ice::ObjectPtr create(const std::string&);
- virtual void destroy();
-
- //
- // Operations from ServantInitializer
- //
- virtual void initialize(const Ice::ObjectAdapterPtr&, const Ice::Identity&, const Ice::ObjectPtr&);
-
-private:
-
- PhoneBookIPtr _phoneBook;
- Freeze::EvictorPtr _evictor;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CONTACT_FACTORY_H +#define CONTACT_FACTORY_H + +#include <PhoneBookI.h> + +class ContactFactory : virtual public Ice::ObjectFactory, virtual public Freeze::ServantInitializer +{ +public: + + ContactFactory(const PhoneBookIPtr&, const Freeze::EvictorPtr&); + + // + // Operations from ObjectFactory + // + virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); + + // + // Operations from ServantInitializer + // + virtual void initialize(const Ice::ObjectAdapterPtr&, const Ice::Identity&, const Ice::ObjectPtr&); + +private: + + PhoneBookIPtr _phoneBook; + Freeze::EvictorPtr _evictor; +}; + +#endif diff --git a/cpp/demo/Freeze/phonebook/Parser.h b/cpp/demo/Freeze/phonebook/Parser.h index 9e53fb9d450..56fbc5b7456 100644 --- a/cpp/demo/Freeze/phonebook/Parser.h +++ b/cpp/demo/Freeze/phonebook/Parser.h @@ -1,106 +1,106 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef PARSER_H
-#define PARSER_H
-
-#include <IceUtil/Handle.h>
-#include <Ice/Ice.h>
-#include <PhoneBook.h>
-#include <list>
-
-#ifdef _WIN32
-# include <io.h>
-# define isatty _isatty
-# define fileno _fileno
-// '_isatty' : inconsistent dll linkage. dllexport assumed.
-# pragma warning( disable : 4273 )
-#endif
-
-//
-// Stuff for flex and bison
-//
-
-#define YYSTYPE std::list<std::string>
-#define YY_DECL int yylex(YYSTYPE* yylvalp)
-YY_DECL;
-int yyparse();
-
-//
-// I must set the initial stack depth to the maximum stack depth to
-// disable bison stack resizing. The bison stack resizing routines use
-// simple malloc/alloc/memcpy calls, which do not work for the
-// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
-// assignment operator, etc.
-//
-#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
-#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
-
-//
-// Newer bison versions allow to disable stack resizing by defining
-// yyoverflow.
-//
-#define yyoverflow(a, b, c, d, e, f) yyerror(a)
-
-class Parser;
-typedef ::IceUtil::Handle<Parser> ParserPtr;
-
-class Parser : public ::IceUtil::SimpleShared
-{
-public:
-
- static ParserPtr createParser(const Ice::CommunicatorPtr&, const PhoneBookPrx&);
-
- void usage();
-
- void addContacts(const std::list<std::string>&);
- void findContacts(const std::list<std::string>&);
- void nextFoundContact();
- void printCurrent();
- void setCurrentName(const std::list<std::string>&);
- void setCurrentAddress(const std::list<std::string>&);
- void setCurrentPhone(const std::list<std::string>&);
- void removeCurrent();
- void setEvictorSize(const std::list<std::string>&);
- void shutdown();
-
- void getInput(char*, int&, int);
- void nextLine();
- void continueLine();
- char* getPrompt();
-
- void error(const char*);
- void error(const std::string&);
-
- void warning(const char*);
- void warning(const std::string&);
-
- int parse(FILE*, bool);
- int parse(const std::string&, bool);
-
-private:
-
- Parser(const Ice::CommunicatorPtr&, const PhoneBookPrx&);
-
- Contacts _foundContacts;
- Contacts::iterator _current;
-
- std::string _commands;
- Ice::CommunicatorPtr _communicator;
- PhoneBookPrx _phoneBook;
- bool _continue;
- int _errors;
- int _currentLine;
- std::string _currentFile;
-};
-
-extern Parser* parser; // The current parser for bison/flex
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef PARSER_H +#define PARSER_H + +#include <IceUtil/Handle.h> +#include <Ice/Ice.h> +#include <PhoneBook.h> +#include <list> + +#ifdef _WIN32 +# include <io.h> +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. +# pragma warning( disable : 4273 ) +#endif + +// +// Stuff for flex and bison +// + +#define YYSTYPE std::list<std::string> +#define YY_DECL int yylex(YYSTYPE* yylvalp) +YY_DECL; +int yyparse(); + +// +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +// +#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum. +#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. + +// +// Newer bison versions allow to disable stack resizing by defining +// yyoverflow. +// +#define yyoverflow(a, b, c, d, e, f) yyerror(a) + +class Parser; +typedef ::IceUtil::Handle<Parser> ParserPtr; + +class Parser : public ::IceUtil::SimpleShared +{ +public: + + static ParserPtr createParser(const Ice::CommunicatorPtr&, const PhoneBookPrx&); + + void usage(); + + void addContacts(const std::list<std::string>&); + void findContacts(const std::list<std::string>&); + void nextFoundContact(); + void printCurrent(); + void setCurrentName(const std::list<std::string>&); + void setCurrentAddress(const std::list<std::string>&); + void setCurrentPhone(const std::list<std::string>&); + void removeCurrent(); + void setEvictorSize(const std::list<std::string>&); + void shutdown(); + + void getInput(char*, int&, int); + void nextLine(); + void continueLine(); + char* getPrompt(); + + void error(const char*); + void error(const std::string&); + + void warning(const char*); + void warning(const std::string&); + + int parse(FILE*, bool); + int parse(const std::string&, bool); + +private: + + Parser(const Ice::CommunicatorPtr&, const PhoneBookPrx&); + + Contacts _foundContacts; + Contacts::iterator _current; + + std::string _commands; + Ice::CommunicatorPtr _communicator; + PhoneBookPrx _phoneBook; + bool _continue; + int _errors; + int _currentLine; + std::string _currentFile; +}; + +extern Parser* parser; // The current parser for bison/flex + +#endif diff --git a/cpp/demo/Freeze/phonebook/PhoneBookI.h b/cpp/demo/Freeze/phonebook/PhoneBookI.h index fa387c15a8d..bb341a7b94a 100644 --- a/cpp/demo/Freeze/phonebook/PhoneBookI.h +++ b/cpp/demo/Freeze/phonebook/PhoneBookI.h @@ -1,77 +1,77 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef PHONE_BOOK_I_H
-#define PHONE_BOOK_I_H
-
-#include <IceUtil/IceUtil.h>
-#include <Ice/Ice.h>
-#include <Freeze/Freeze.h>
-#include <PhoneBook.h>
-#include <NameIdentitiesDict.h>
-
-class PhoneBookI;
-typedef IceUtil::Handle<PhoneBookI> PhoneBookIPtr;
-
-class ContactI;
-typedef IceUtil::Handle<ContactI> ContactIPtr;
-
-class ContactI : public Contact, public IceUtil::RWRecMutex
-{
-public:
-
- ContactI(const PhoneBookIPtr&, const Freeze::EvictorPtr&);
-
- void setIdentity(const Ice::Identity&);
-
- virtual std::string getName(const Ice::Current&);
- virtual void setName(const std::string&, const Ice::Current&);
-
- virtual std::string getAddress(const Ice::Current&);
- virtual void setAddress(const std::string&, const Ice::Current&);
-
- virtual std::string getPhone(const Ice::Current&);
- virtual void setPhone(const std::string&, const Ice::Current&);
-
- virtual void destroy(const Ice::Current&);
-
-private:
-
- PhoneBookIPtr _phoneBook;
- Freeze::EvictorPtr _evictor;
- Ice::Identity _identity;
-};
-
-class PhoneBookI : public PhoneBook, public IceUtil::RWRecMutex
-{
-public:
-
- PhoneBookI(const Ice::ObjectAdapterPtr&, const Freeze::DBPtr&, const Freeze::EvictorPtr&);
-
- virtual ContactPrx createContact(const Ice::Current&);
- virtual Contacts findContacts(const std::string&, const Ice::Current&);
- virtual void setEvictorSize(Ice::Int, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
- void remove(const Ice::Identity&, const std::string&);
- void move(const Ice::Identity&, const std::string&, const std::string&);
- Ice::Identity getNewIdentity();
-
-private:
-
- void removeI(const Ice::Identity&, const std::string&);
-
- Ice::ObjectAdapterPtr _adapter;
- Freeze::DBPtr _db;
- Freeze::EvictorPtr _evictor;
- NameIdentitiesDict _nameIdentitiesDict;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef PHONE_BOOK_I_H +#define PHONE_BOOK_I_H + +#include <IceUtil/IceUtil.h> +#include <Ice/Ice.h> +#include <Freeze/Freeze.h> +#include <PhoneBook.h> +#include <NameIdentitiesDict.h> + +class PhoneBookI; +typedef IceUtil::Handle<PhoneBookI> PhoneBookIPtr; + +class ContactI; +typedef IceUtil::Handle<ContactI> ContactIPtr; + +class ContactI : public Contact, public IceUtil::RWRecMutex +{ +public: + + ContactI(const PhoneBookIPtr&, const Freeze::EvictorPtr&); + + void setIdentity(const Ice::Identity&); + + virtual std::string getName(const Ice::Current&); + virtual void setName(const std::string&, const Ice::Current&); + + virtual std::string getAddress(const Ice::Current&); + virtual void setAddress(const std::string&, const Ice::Current&); + + virtual std::string getPhone(const Ice::Current&); + virtual void setPhone(const std::string&, const Ice::Current&); + + virtual void destroy(const Ice::Current&); + +private: + + PhoneBookIPtr _phoneBook; + Freeze::EvictorPtr _evictor; + Ice::Identity _identity; +}; + +class PhoneBookI : public PhoneBook, public IceUtil::RWRecMutex +{ +public: + + PhoneBookI(const Ice::ObjectAdapterPtr&, const Freeze::DBPtr&, const Freeze::EvictorPtr&); + + virtual ContactPrx createContact(const Ice::Current&); + virtual Contacts findContacts(const std::string&, const Ice::Current&); + virtual void setEvictorSize(Ice::Int, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + + void remove(const Ice::Identity&, const std::string&); + void move(const Ice::Identity&, const std::string&, const std::string&); + Ice::Identity getNewIdentity(); + +private: + + void removeI(const Ice::Identity&, const std::string&); + + Ice::ObjectAdapterPtr _adapter; + Freeze::DBPtr _db; + Freeze::EvictorPtr _evictor; + NameIdentitiesDict _nameIdentitiesDict; +}; + +#endif diff --git a/cpp/demo/Freeze/phonebook/dummyinclude/unistd.h b/cpp/demo/Freeze/phonebook/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/demo/Freeze/phonebook/dummyinclude/unistd.h +++ b/cpp/demo/Freeze/phonebook/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/demo/Glacier/session/HelloSessionI.h b/cpp/demo/Glacier/session/HelloSessionI.h index a270e50a472..0638969f6ab 100644 --- a/cpp/demo/Glacier/session/HelloSessionI.h +++ b/cpp/demo/Glacier/session/HelloSessionI.h @@ -1,48 +1,48 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef HELLO_SESSION_I_H
-#define HELLO_SESSION_I_H
-
-#include <Glacier/SessionManager.h>
-#include <HelloSession.h>
-
-class HelloSessionManagerI : public Glacier::SessionManager
-{
-public:
-
- HelloSessionManagerI(const Ice::ObjectAdapterPtr&);
-
- virtual Glacier::SessionPrx create(const ::std::string&, const Ice::Current&);
-
- void remove(const Ice::Identity&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
-};
-typedef IceUtil::Handle<HelloSessionManagerI> HelloSessionManagerIPtr;
-
-class HelloSessionI : public HelloSession
-{
-public:
-
- HelloSessionI(const ::std::string&, const HelloSessionManagerIPtr&);
-
- virtual void destroy(const Ice::Current&);
- virtual void hello(const Ice::Current&);
-
-private:
-
- ::std::string _userId;
- HelloSessionManagerIPtr _manager;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef HELLO_SESSION_I_H +#define HELLO_SESSION_I_H + +#include <Glacier/SessionManager.h> +#include <HelloSession.h> + +class HelloSessionManagerI : public Glacier::SessionManager +{ +public: + + HelloSessionManagerI(const Ice::ObjectAdapterPtr&); + + virtual Glacier::SessionPrx create(const ::std::string&, const Ice::Current&); + + void remove(const Ice::Identity&); + +private: + + Ice::ObjectAdapterPtr _adapter; +}; +typedef IceUtil::Handle<HelloSessionManagerI> HelloSessionManagerIPtr; + +class HelloSessionI : public HelloSession +{ +public: + + HelloSessionI(const ::std::string&, const HelloSessionManagerIPtr&); + + virtual void destroy(const Ice::Current&); + virtual void hello(const Ice::Current&); + +private: + + ::std::string _userId; + HelloSessionManagerIPtr _manager; +}; + +#endif diff --git a/cpp/demo/Ice/callback/CallbackI.h b/cpp/demo/Ice/callback/CallbackI.h index 30359a00f92..72a1dfbe7e2 100644 --- a/cpp/demo/Ice/callback/CallbackI.h +++ b/cpp/demo/Ice/callback/CallbackI.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CALLBACK_I_H
-#define CALLBACK_I_H
-
-#include <Callback.h>
-
-class CallbackReceiverI : public CallbackReceiver
-{
-public:
-
- virtual void callback(const Ice::Current&);
-};
-
-class CallbackI : public Callback
-{
-public:
-
- CallbackI(const Ice::CommunicatorPtr&);
-
- virtual void initiateCallback(const CallbackReceiverPrx&, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CALLBACK_I_H +#define CALLBACK_I_H + +#include <Callback.h> + +class CallbackReceiverI : public CallbackReceiver +{ +public: + + virtual void callback(const Ice::Current&); +}; + +class CallbackI : public Callback +{ +public: + + CallbackI(const Ice::CommunicatorPtr&); + + virtual void initiateCallback(const CallbackReceiverPrx&, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +#endif diff --git a/cpp/demo/Ice/hello/HelloI.h b/cpp/demo/Ice/hello/HelloI.h index 210d4135f8d..88801bbcd8b 100644 --- a/cpp/demo/Ice/hello/HelloI.h +++ b/cpp/demo/Ice/hello/HelloI.h @@ -1,30 +1,30 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef HELLO_I_H
-#define HELLO_I_H
-
-#include <Hello.h>
-
-class HelloI : public Hello
-{
-public:
-
- HelloI(const Ice::CommunicatorPtr&);
-
- virtual void hello(const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef HELLO_I_H +#define HELLO_I_H + +#include <Hello.h> + +class HelloI : public Hello +{ +public: + + HelloI(const Ice::CommunicatorPtr&); + + virtual void hello(const Ice::Current&); + virtual void shutdown(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +#endif diff --git a/cpp/demo/Ice/nested/NestedI.h b/cpp/demo/Ice/nested/NestedI.h index 27960cbe2b8..8b5293c53c3 100644 --- a/cpp/demo/Ice/nested/NestedI.h +++ b/cpp/demo/Ice/nested/NestedI.h @@ -1,28 +1,28 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef NESTED_I_H
-#define NESTED_I_H
-
-#include <Nested.h>
-
-class NestedI : public Nested
-{
-public:
-
- NestedI(const NestedPrx&);
- virtual void nested(Ice::Int, const NestedPrx&, const Ice::Current&);
-
-private:
-
- NestedPrx _self;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef NESTED_I_H +#define NESTED_I_H + +#include <Nested.h> + +class NestedI : public Nested +{ +public: + + NestedI(const NestedPrx&); + virtual void nested(Ice::Int, const NestedPrx&, const Ice::Current&); + +private: + + NestedPrx _self; +}; + +#endif diff --git a/cpp/demo/Ice/value/ObjectFactory.h b/cpp/demo/Ice/value/ObjectFactory.h index 2056fcdcb8e..463ccef33fe 100644 --- a/cpp/demo/Ice/value/ObjectFactory.h +++ b/cpp/demo/Ice/value/ObjectFactory.h @@ -1,22 +1,22 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SERVANT_FACTORY_H
-#define SERVANT_FACTORY_H
-
-class ObjectFactory : public Ice::ObjectFactory
-{
-public:
-
- virtual Ice::ObjectPtr create(const std::string&);
- virtual void destroy();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SERVANT_FACTORY_H +#define SERVANT_FACTORY_H + +class ObjectFactory : public Ice::ObjectFactory +{ +public: + + virtual Ice::ObjectPtr create(const std::string&); + virtual void destroy(); +}; + +#endif diff --git a/cpp/demo/Ice/value/ValueI.h b/cpp/demo/Ice/value/ValueI.h index 2deb75497a2..ee710b34e56 100644 --- a/cpp/demo/Ice/value/ValueI.h +++ b/cpp/demo/Ice/value/ValueI.h @@ -1,50 +1,50 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef VALUE_I_H
-#define VALUE_I_H
-
-#include <Value.h>
-
-class InitialI : public Initial
-{
-public:
-
- InitialI(const Ice::ObjectAdapterPtr&);
-
- virtual SimplePtr simple(const Ice::Current&);
- virtual void printer(PrinterPtr&, PrinterPrx&, const Ice::Current&);
- virtual PrinterPtr derivedPrinter(const Ice::Current&);
- virtual void throwDerivedPrinter(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- SimplePtr _simple;
- PrinterPtr _printer;
- PrinterPrx _printerProxy;
- DerivedPrinterPtr _derivedPrinter;
-};
-
-class PrinterI : virtual public Printer
-{
-public:
-
- virtual void printBackwards(const Ice::Current&);
-};
-
-class DerivedPrinterI : virtual public DerivedPrinter, virtual public PrinterI
-{
-public:
-
- virtual void printUppercase(const Ice::Current&);
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef VALUE_I_H +#define VALUE_I_H + +#include <Value.h> + +class InitialI : public Initial +{ +public: + + InitialI(const Ice::ObjectAdapterPtr&); + + virtual SimplePtr simple(const Ice::Current&); + virtual void printer(PrinterPtr&, PrinterPrx&, const Ice::Current&); + virtual PrinterPtr derivedPrinter(const Ice::Current&); + virtual void throwDerivedPrinter(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; + SimplePtr _simple; + PrinterPtr _printer; + PrinterPrx _printerProxy; + DerivedPrinterPtr _derivedPrinter; +}; + +class PrinterI : virtual public Printer +{ +public: + + virtual void printBackwards(const Ice::Current&); +}; + +class DerivedPrinterI : virtual public DerivedPrinter, virtual public PrinterI +{ +public: + + virtual void printUppercase(const Ice::Current&); +}; + +#endif diff --git a/cpp/demo/IceBox/hello/HelloI.h b/cpp/demo/IceBox/hello/HelloI.h index 0e0028b66fe..3a08e54b241 100644 --- a/cpp/demo/IceBox/hello/HelloI.h +++ b/cpp/demo/IceBox/hello/HelloI.h @@ -1,36 +1,36 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef HELLO_I_H
-#define HELLO_I_H
-
-#include <Hello.h>
-
-#if defined(_WIN32)
-# define HELLO_API __declspec(dllexport)
-#else
-# define HELLO_API /**/
-#endif
-
-class HELLO_API HelloI : public Hello
-{
-public:
-
- HelloI(const Ice::CommunicatorPtr&);
-
- virtual void hello(const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef HELLO_I_H +#define HELLO_I_H + +#include <Hello.h> + +#if defined(_WIN32) +# define HELLO_API __declspec(dllexport) +#else +# define HELLO_API /**/ +#endif + +class HELLO_API HelloI : public Hello +{ +public: + + HelloI(const Ice::CommunicatorPtr&); + + virtual void hello(const Ice::Current&); + virtual void shutdown(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +#endif diff --git a/cpp/demo/IceBox/hello/HelloServiceI.h b/cpp/demo/IceBox/hello/HelloServiceI.h index 72d2a06f007..6d0601e3d31 100644 --- a/cpp/demo/IceBox/hello/HelloServiceI.h +++ b/cpp/demo/IceBox/hello/HelloServiceI.h @@ -1,43 +1,43 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef HELLO_SERVICE_I_H
-#define HELLO_SERVICE_I_H
-
-#include <IceBox/IceBox.h>
-
-#if defined(_WIN32)
-# define HELLO_API __declspec(dllexport)
-#else
-# define HELLO_API /**/
-#endif
-
-class HELLO_API HelloServiceI : public ::IceBox::Service
-{
-public:
-
- HelloServiceI();
- virtual ~HelloServiceI();
-
- virtual void init(const ::std::string&,
- const ::Ice::CommunicatorPtr&,
- const ::Ice::PropertiesPtr&,
- const ::Ice::StringSeq&);
-
- virtual void start();
-
- virtual void stop();
-
-private:
-
- ::Ice::ObjectAdapterPtr _adapter;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef HELLO_SERVICE_I_H +#define HELLO_SERVICE_I_H + +#include <IceBox/IceBox.h> + +#if defined(_WIN32) +# define HELLO_API __declspec(dllexport) +#else +# define HELLO_API /**/ +#endif + +class HELLO_API HelloServiceI : public ::IceBox::Service +{ +public: + + HelloServiceI(); + virtual ~HelloServiceI(); + + virtual void init(const ::std::string&, + const ::Ice::CommunicatorPtr&, + const ::Ice::PropertiesPtr&, + const ::Ice::StringSeq&); + + virtual void start(); + + virtual void stop(); + +private: + + ::Ice::ObjectAdapterPtr _adapter; +}; + +#endif diff --git a/cpp/demo/IceStorm/clock/ClockI.h b/cpp/demo/IceStorm/clock/ClockI.h index c1d8eb880bc..0924e0cf43f 100644 --- a/cpp/demo/IceStorm/clock/ClockI.h +++ b/cpp/demo/IceStorm/clock/ClockI.h @@ -1,23 +1,23 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CLOCK_I_H
-#define CLOCK_I_H
-
-#include <Clock.h>
-
-class ClockI : public Clock
-{
-public:
-
- virtual void tick(const Ice::Current&);
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CLOCK_I_H +#define CLOCK_I_H + +#include <Clock.h> + +class ClockI : public Clock +{ +public: + + virtual void tick(const Ice::Current&); +}; + +#endif diff --git a/cpp/include/Freeze/Application.h b/cpp/include/Freeze/Application.h index decbed3f696..5050a360be8 100644 --- a/cpp/include/Freeze/Application.h +++ b/cpp/include/Freeze/Application.h @@ -1,48 +1,48 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_APPLICATION_H
-#define FREEZE_APPLICATION_H
-
-#ifdef _WIN32
-# ifdef FREEZE_API_EXPORTS
-# define FREEZE_API __declspec(dllexport)
-# else
-# define FREEZE_API __declspec(dllimport)
-# endif
-#else
-# define FREEZE_API /**/
-#endif
-
-#include <Ice/Application.h>
-#include <Freeze/Freeze.h>
-
-namespace Freeze
-{
-
-class FREEZE_API Application : public Ice::Application
-{
-public:
-
- Application(const std::string&);
- virtual ~Application();
-
- virtual int runFreeze(int, char*[], const DBEnvironmentPtr&) = 0;
-
-private:
-
- virtual int run(int, char*[]);
-
- const std::string _dbEnvName;
-};
-
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_APPLICATION_H +#define FREEZE_APPLICATION_H + +#ifdef _WIN32 +# ifdef FREEZE_API_EXPORTS +# define FREEZE_API __declspec(dllexport) +# else +# define FREEZE_API __declspec(dllimport) +# endif +#else +# define FREEZE_API /**/ +#endif + +#include <Ice/Application.h> +#include <Freeze/Freeze.h> + +namespace Freeze +{ + +class FREEZE_API Application : public Ice::Application +{ +public: + + Application(const std::string&); + virtual ~Application(); + + virtual int runFreeze(int, char*[], const DBEnvironmentPtr&) = 0; + +private: + + virtual int run(int, char*[]); + + const std::string _dbEnvName; +}; + +}; + +#endif diff --git a/cpp/include/Freeze/Freeze.h b/cpp/include/Freeze/Freeze.h index 24cbd11f9b2..1a04dedab75 100644 --- a/cpp/include/Freeze/Freeze.h +++ b/cpp/include/Freeze/Freeze.h @@ -1,19 +1,19 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_FREEZE_H
-#define FREEZE_FREEZE_H
-
-#include <Freeze/Initialize.h>
-#include <Freeze/DB.h>
-#include <Freeze/Evictor.h>
-#include <Freeze/Map.h>
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_FREEZE_H +#define FREEZE_FREEZE_H + +#include <Freeze/Initialize.h> +#include <Freeze/DB.h> +#include <Freeze/Evictor.h> +#include <Freeze/Map.h> + +#endif diff --git a/cpp/include/Freeze/Initialize.h b/cpp/include/Freeze/Initialize.h index 20c97972296..b68647805f0 100644 --- a/cpp/include/Freeze/Initialize.h +++ b/cpp/include/Freeze/Initialize.h @@ -1,34 +1,34 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_INITIALIZE_H
-#define FREEZE_INITIALIZE_H
-
-#include <Ice/Ice.h>
-#include <Freeze/DBF.h>
-
-#ifdef _WIN32
-# ifdef FREEZE_API_EXPORTS
-# define FREEZE_API __declspec(dllexport)
-# else
-# define FREEZE_API __declspec(dllimport)
-# endif
-#else
-# define FREEZE_API /**/
-#endif
-
-namespace Freeze
-{
-
-FREEZE_API DBEnvironmentPtr initialize(const ::Ice::CommunicatorPtr&, const std::string&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_INITIALIZE_H +#define FREEZE_INITIALIZE_H + +#include <Ice/Ice.h> +#include <Freeze/DBF.h> + +#ifdef _WIN32 +# ifdef FREEZE_API_EXPORTS +# define FREEZE_API __declspec(dllexport) +# else +# define FREEZE_API __declspec(dllimport) +# endif +#else +# define FREEZE_API /**/ +#endif + +namespace Freeze +{ + +FREEZE_API DBEnvironmentPtr initialize(const ::Ice::CommunicatorPtr&, const std::string&); + +} + +#endif diff --git a/cpp/include/Freeze/Map.h b/cpp/include/Freeze/Map.h index 47f28f2c320..d02d5c4ca6b 100644 --- a/cpp/include/Freeze/Map.h +++ b/cpp/include/Freeze/Map.h @@ -1,805 +1,805 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_MAP_H
-#define FREEZE_MAP_H
-
-#include <Ice/Ice.h>
-#include <Freeze/DB.h>
-
-#include <iterator>
-
-namespace Freeze
-{
-
-//
-// Forward declaration
-//
-template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec>
-class DBMap;
-template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec>
-class ConstDBIterator;
-
-//
-// This is necessary for MSVC support.
-//
-struct DBIteratorBase
-{
- typedef std::forward_iterator_tag iterator_category;
-};
-
-//
-// Database iterator. This implements a forward iterator with the
-// restriction that it's only possible to explicitely write back into
-// the database.
-//
-// Equality and inequality are based on whether the iterator is
-// "valid". An valid iterator contains a valid database and cursor
-// pointer, otherwise the iterator is invalid.
-//
-// TODO: It's possible to implement bidirectional iterators, if
-// necessary.
-//
-template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec>
-class DBIterator : public DBIteratorBase
-{
-public:
-
- typedef ptrdiff_t difference_type;
-
- typedef std::pair<const key_type, const mapped_type> value_type;
-
- typedef value_type* pointer;
-
- typedef value_type& reference;
-
- DBIterator(const DBPtr& db, const DBCursorPtr& cursor)
- : _db(db), _cursor(cursor)
- {
- }
-
- DBIterator()
- {
- }
-
- DBIterator(const DBIterator& rhs)
- {
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
- }
-
- DBIterator& operator=(const DBIterator& rhs)
- {
- if(_cursor)
- {
- _cursor->close();
- }
-
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
-
- return *this;
- }
-
- ~DBIterator()
- {
- if(_cursor)
- {
- _cursor->close();
- }
- }
-
- bool operator==(const DBIterator& rhs) const
- {
- if(!_db && !rhs._db)
- {
- return true;
- }
- return false;
- }
-
- bool operator!=(const DBIterator& rhs) const
- {
- return !(*this == rhs);
- }
-
- DBIterator& operator++()
- {
- incr();
- return *this;
- }
-
- DBIterator operator++(int)
- {
- DBIterator tmp = *this;
- tmp.incr();
- return tmp;
- }
-
- //
- // Note that this doesn't follow the regular iterator mapping:
- //
- // value_type& operator*(), value_type operator*() const
- //
- value_type& operator*() const
- {
- key_type key;
- mapped_type value;
-
- getCurrentValue(key, value);
-
- //
- // !IMPORTANT!
- //
- // This method has to cache the returned value to implement
- // operator->().
- //
- const_cast<key_type&>(_ref.first) = key;
- const_cast<mapped_type&>(_ref.second) = value;
- return _ref;
- }
-
- value_type* operator->() { return &(operator*()); }
-
- //
- // This special method allows writing back into the database.
- //
- void set(const mapped_type& value)
- {
- Freeze::Value v;
- ValueCodec::write(value, v, _db->getCommunicator());
- _cursor->set(v);
- }
-
-private:
-
- void incr()
- {
- assert(_cursor && _db);
- if(!_cursor->next())
- {
- //
- // The iterator has been moved past the end, and is now
- // invalid.
- //
- _cursor->close();
- _cursor = 0;
- _db = 0;
- }
- }
-
- void getCurrentValue(key_type& key, mapped_type& value) const
- {
- Freeze::Key k;
- Freeze::Value v;
-
- _cursor->curr(k, v);
-
- ::Ice::CommunicatorPtr communicator = _db->getCommunicator();
- KeyCodec::read(key, k, communicator);
- ValueCodec::read(value, v, communicator);
- }
-
- friend class ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec>;
- friend class DBMap<key_type, mapped_type, KeyCodec, ValueCodec>;
-
- DBPtr _db;
- DBCursorPtr _cursor;
-
- //
- // Cached last return value. This is so that operator->() can
- // actually return a pointer.
- //
- mutable value_type _ref;
-};
-
-//
-// See DBIterator comments for design notes
-//
-template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec>
-class ConstDBIterator : public DBIteratorBase
-{
-public:
-
- typedef ptrdiff_t difference_type;
-
- typedef std::pair<const key_type, const mapped_type> value_type;
-
- typedef value_type* pointer;
-
- typedef value_type& reference;
-
- ConstDBIterator(const DBPtr& db, const DBCursorPtr& cursor)
- : _db(db), _cursor(cursor)
- {
- }
- ConstDBIterator() { }
-
- ConstDBIterator(const ConstDBIterator& rhs)
- {
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
- }
-
- //
- // A DBIterator can be converted to a ConstDBIterator (but not
- // vice versa) - same for operator=.
- //
- ConstDBIterator(const DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>& rhs)
- {
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
- }
-
- ConstDBIterator& operator=(const ConstDBIterator& rhs)
- {
- if(_cursor)
- {
- _cursor->close();
- }
-
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
-
- return *this;
- }
-
- //
- // Create const_iterator from iterator.
- //
- ConstDBIterator& operator=(const DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>& rhs)
- {
- if(_cursor)
- {
- _cursor->close();
- }
-
- if(rhs._cursor)
- {
- _cursor = rhs._cursor->clone();
- }
-
- _db = rhs._db;
-
- return *this;
- }
-
- ~ConstDBIterator()
- {
- if(_cursor)
- {
- _cursor->close();
- }
- }
-
- bool operator==(const ConstDBIterator& rhs)
- {
- if(!_db && !rhs._db)
- {
- return true;
- }
- return false;
- }
-
- bool operator!=(const ConstDBIterator& rhs)
- {
- return !(*this == rhs);
- }
-
- ConstDBIterator& operator++()
- {
- incr();
- return *this;
- }
-
- ConstDBIterator operator++(int)
- {
- ConstDBIterator tmp = *this;
- tmp.incr();
- return tmp;
- }
-
- //
- // Note that this doesn't follow the regular iterator mapping:
- //
- // value_type operator*() const
- //
- value_type& operator*() const
- {
- key_type key;
- mapped_type value;
-
- getCurrentValue(key, value);
-
- //
- // !IMPORTANT!
- //
- // This method has to cache the returned value to implement
- // operator->().
- //
- const_cast<key_type&>(_ref.first) = key;
- const_cast<mapped_type&>(_ref.second) = value;
- return _ref;
- }
-
- pointer operator->() const { return &(operator*()); }
-
-private:
-
- void incr()
- {
- assert(_cursor);
- if(!_cursor->next())
- {
- //
- // The iterator has been moved past the end, and is now
- // invalid.
- //
- _cursor->close();
- _cursor = 0;
- _db = 0;
- }
- }
-
- void getCurrentValue(key_type& key, mapped_type& value) const
- {
- Freeze::Key k;
- Freeze::Value v;
-
- _cursor->curr(k, v);
-
- ::Ice::CommunicatorPtr communicator = _db->getCommunicator();
- KeyCodec::read(key, k, communicator);
- ValueCodec::read(value, v, communicator);
- }
-
- friend class DBMap<key_type, mapped_type, KeyCodec, ValueCodec>;
-
- DBPtr _db;
- DBCursorPtr _cursor;
-
- //
- // Cached last return value. This is so that operator->() can
- // actually return a pointer.
- //
- mutable value_type _ref;
-};
-
-//
-// This is an STL container that matches the requirements of a
-// Associated Container - with the restriction that operator[] isn't
-// implemented. It also supports the same interface as a Hashed
-// Associative Container (with the above restrictions), except the
-// hasher & key_equal methods.
-//
-// TODO: If necessary it would be possible to implement reverse and
-// bidirectional iterators.
-//
-template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec>
-class DBMap
-{
-public:
-
- typedef std::pair<const key_type, const mapped_type> value_type;
-
- //
- // These are not supported:
- //
- // hasher, key_equal, key_compare, value_compare
- //
-
- typedef DBIterator<key_type, mapped_type, KeyCodec, ValueCodec > iterator;
- typedef ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec > const_iterator;
-
- //
- // No definition for reference, const_reference, pointer or
- // const_pointer.
- //
-
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
-
- //
- // Allocators are not supported.
- //
- // allocator_type
- //
-
- //
- // Constructors
- //
- DBMap(const DBPtr& db) :
- _db(db)
- {
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- DBMap(const DBPtr& db, _InputIterator first, _InputIterator last) :
- _db(db)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
-#else
- DBMap(const DBPtr& db, const value_type* first, const value_type* last) :
- _db(db)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
- DBMap(const DBPtr& db, const_iterator first, const_iterator last) :
- _db(db)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
-#endif /*__STL_MEMBER_TEMPLATES */
-
- ~DBMap()
- {
- }
-
- //
- // Neither of these operations are supported.
- //
- // key_compare key_comp() const, value_compare value_comp() const,
- // hasher hash_funct() const, key_equal key_eq() const
- //
-
- bool operator==(const DBMap& rhs) const
- {
- //
- // This does a memberwise equality for the entire contents of
- // the database. While slow this is always correct. Database
- // equality is not necessarily correct in the context of a
- // transaction.
- //
- if(count() != rhs.count())
- return false;
-
- for(const_iterator p = rhs.begin() ; p != rhs.end() ; ++p)
- {
- const_iterator q = rhs.find(p->first);
- if(q == rhs.end())
- {
- return false;
- }
- if(p->second != q->second)
- {
- return false;
- }
- }
- return true;
- }
-
- bool operator!=(const DBMap& rhs) const
- {
- return !(*this == rhs);
- }
-
- void swap(DBMap& rhs)
- {
- DBPtr tmp = _db;
- _db = rhs._db;
- rhs._db = tmp;
- }
-
- iterator begin()
- {
- try
- {
- return iterator(_db, _db->getCursor());
- }
- catch(const DBNotFoundException&)
- {
- return iterator();
- }
- }
- const_iterator begin() const
- {
- try
- {
- return const_iterator(_db, _db->getCursor());
- }
- catch(const DBNotFoundException&)
- {
- return const_iterator();
- }
- }
-
- iterator end()
- {
- return iterator();
- }
-
- const_iterator end() const
- {
- return const_iterator();
- }
-
- bool empty() const
- {
- return size() == 0;
- }
-
- size_type size() const
- {
- return (size_type)_db->getNumberOfRecords();
- }
-
- size_type max_size() const
- {
- return 0xffffffff; // TODO: is this the max?
- }
-
- //
- // This method isn't implemented.
- //
- // mapped_type& operator[](const key_type& key)
- //
-
- //
- // This method isn't in the STLport library - but it's referenced
- // in "STL Tutorial and Refrence Guide, Second Edition". It's not
- // currently implemented.
- //
- // const mapped_type& operator[](const key_type& key) const;
- //
-
- //
- // No allocators.
- //
- //allocator_type get_allocator() const;
- //
-
- iterator insert(iterator /*position*/, const value_type& key)
- {
- //
- // position is ignored.
- //
- ::Ice::CommunicatorPtr communicator = _db->getCommunicator();
-
- Freeze::Key k;
- Freeze::Value v;
- KeyCodec::write(key.first, k, communicator);
- ValueCodec::write(key.second, v, communicator);
-
- _db->put(k, v);
- DBCursorPtr cursor = _db->getCursorAtKey(k);
-
- return iterator(_db, cursor);
- }
-
- std::pair<iterator, bool> insert(const value_type& key)
- {
- ::Ice::CommunicatorPtr communicator = _db->getCommunicator();
-
- Freeze::Key k;
- Freeze::Value v;
- KeyCodec::write(key.first, k, communicator);
- ValueCodec::write(key.second, v, communicator);
-
- DBCursorPtr cursor;
- bool inserted;
-
- try
- {
- //
- // Does the value exist already?
- //
- cursor = _db->getCursorAtKey(k);
- inserted = false;
- }
- catch(const DBNotFoundException&)
- {
- inserted = true;
- }
-
- _db->put(k, v);
- if(inserted)
- {
- cursor = _db->getCursorAtKey(k);
- }
- return std::pair<iterator, bool>(iterator(_db, cursor), inserted);
- }
-
-#ifdef __STL_MEMBER_TEMPLATES
- template <typename InputIterator>
- void insert(InputIterator first, InputIterator last)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
-#else
- void insert(const value_type* first, const value_type* last)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
- void insert(const_iterator first, const_iterator last)
- {
- while(first != last)
- {
- insert(*first);
- ++first;
- }
- }
-#endif
-
- void erase(iterator position)
- {
- position._cursor->del();
- }
-
- size_type erase(const key_type& key)
- {
- Freeze::Key k;
- KeyCodec::write(key, k, _db->getCommunicator());
-
- try
- {
- _db->del(k);
- }
- catch(const DBNotFoundException&)
- {
- return 0;
- }
-
- return 1;
- }
-
- void erase(iterator first, iterator last)
- {
- while(first != last)
- {
- first._cursor->del();
- ++first;
- }
- }
-
- void clear()
- {
- _db->clear();
- }
-
- iterator find(const key_type& key)
- {
- Freeze::Key k;
- KeyCodec::write(key, k, _db->getCommunicator());
-
- try
- {
- DBCursorPtr cursor = _db->getCursorAtKey(k);
- return iterator(_db, cursor);
- }
- catch(const DBNotFoundException&)
- {
- //
- // The record doesn't exist, return the end() iterator.
- //
- }
- return end();
- }
-
- const_iterator find(const key_type& key) const
- {
- Freeze::Key k;
- KeyCodec::write(key, k, _db->getCommunicator());
-
- try
- {
- DBCursorPtr cursor = _db->getCursorAtKey(k);
- return const_iterator(_db, cursor);
- }
- catch(const DBNotFoundException&)
- {
- //
- // The record doesn't exist, return the end() iterator.
- //
- }
- return end();
- }
-
- size_type count(const key_type& key) const
- {
- if(find(key) != end())
- return 1;
- return 0;
- }
-
- std::pair<iterator, iterator> equal_range(const key_type& key)
- {
- iterator p = find(key);
- return std::pair<iterator,iterator>(p,p);
- }
-
- std::pair<const_iterator, const_iterator> equal_range(const key_type& key) const
- {
- const_iterator p = find(key);
- return std::pair<const_iterator,const_iterator>(p,p);
- }
-
-private:
-
- DBPtr _db;
-};
-
-} // End namespace Freeze
-
-//
-// This is for MSVC.
-//
-# ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES
-namespace std
-{
-
-//XXX update
-template <class key_type, class mapped_type, class KeyCodec, class ValueCodec>
-inline pair<const key_type, const mapped_type>*
-value_type(const Freeze::DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>&)
-{
- return (pair<const key_type, const mapped_type>*)0;
-}
-
-template <class key_type, class mapped_type, class KeyCodec, class ValueCodec>
-inline pair<const key_type, const mapped_type>*
-value_type(const Freeze::ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec>&)
-{
- return (pair<const key_type, const mapped_type>*)0;
-}
-
-inline forward_iterator_tag iterator_category(const Freeze::DBIteratorBase&)
-{
- return forward_iterator_tag();
-}
-
-inline ptrdiff_t* distance_type(const Freeze::DBIteratorBase&) { return (ptrdiff_t*) 0; }
-
-} // End namespace std
-
-#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_MAP_H +#define FREEZE_MAP_H + +#include <Ice/Ice.h> +#include <Freeze/DB.h> + +#include <iterator> + +namespace Freeze +{ + +// +// Forward declaration +// +template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec> +class DBMap; +template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec> +class ConstDBIterator; + +// +// This is necessary for MSVC support. +// +struct DBIteratorBase +{ + typedef std::forward_iterator_tag iterator_category; +}; + +// +// Database iterator. This implements a forward iterator with the +// restriction that it's only possible to explicitely write back into +// the database. +// +// Equality and inequality are based on whether the iterator is +// "valid". An valid iterator contains a valid database and cursor +// pointer, otherwise the iterator is invalid. +// +// TODO: It's possible to implement bidirectional iterators, if +// necessary. +// +template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec> +class DBIterator : public DBIteratorBase +{ +public: + + typedef ptrdiff_t difference_type; + + typedef std::pair<const key_type, const mapped_type> value_type; + + typedef value_type* pointer; + + typedef value_type& reference; + + DBIterator(const DBPtr& db, const DBCursorPtr& cursor) + : _db(db), _cursor(cursor) + { + } + + DBIterator() + { + } + + DBIterator(const DBIterator& rhs) + { + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + } + + DBIterator& operator=(const DBIterator& rhs) + { + if(_cursor) + { + _cursor->close(); + } + + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + + return *this; + } + + ~DBIterator() + { + if(_cursor) + { + _cursor->close(); + } + } + + bool operator==(const DBIterator& rhs) const + { + if(!_db && !rhs._db) + { + return true; + } + return false; + } + + bool operator!=(const DBIterator& rhs) const + { + return !(*this == rhs); + } + + DBIterator& operator++() + { + incr(); + return *this; + } + + DBIterator operator++(int) + { + DBIterator tmp = *this; + tmp.incr(); + return tmp; + } + + // + // Note that this doesn't follow the regular iterator mapping: + // + // value_type& operator*(), value_type operator*() const + // + value_type& operator*() const + { + key_type key; + mapped_type value; + + getCurrentValue(key, value); + + // + // !IMPORTANT! + // + // This method has to cache the returned value to implement + // operator->(). + // + const_cast<key_type&>(_ref.first) = key; + const_cast<mapped_type&>(_ref.second) = value; + return _ref; + } + + value_type* operator->() { return &(operator*()); } + + // + // This special method allows writing back into the database. + // + void set(const mapped_type& value) + { + Freeze::Value v; + ValueCodec::write(value, v, _db->getCommunicator()); + _cursor->set(v); + } + +private: + + void incr() + { + assert(_cursor && _db); + if(!_cursor->next()) + { + // + // The iterator has been moved past the end, and is now + // invalid. + // + _cursor->close(); + _cursor = 0; + _db = 0; + } + } + + void getCurrentValue(key_type& key, mapped_type& value) const + { + Freeze::Key k; + Freeze::Value v; + + _cursor->curr(k, v); + + ::Ice::CommunicatorPtr communicator = _db->getCommunicator(); + KeyCodec::read(key, k, communicator); + ValueCodec::read(value, v, communicator); + } + + friend class ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec>; + friend class DBMap<key_type, mapped_type, KeyCodec, ValueCodec>; + + DBPtr _db; + DBCursorPtr _cursor; + + // + // Cached last return value. This is so that operator->() can + // actually return a pointer. + // + mutable value_type _ref; +}; + +// +// See DBIterator comments for design notes +// +template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec> +class ConstDBIterator : public DBIteratorBase +{ +public: + + typedef ptrdiff_t difference_type; + + typedef std::pair<const key_type, const mapped_type> value_type; + + typedef value_type* pointer; + + typedef value_type& reference; + + ConstDBIterator(const DBPtr& db, const DBCursorPtr& cursor) + : _db(db), _cursor(cursor) + { + } + ConstDBIterator() { } + + ConstDBIterator(const ConstDBIterator& rhs) + { + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + } + + // + // A DBIterator can be converted to a ConstDBIterator (but not + // vice versa) - same for operator=. + // + ConstDBIterator(const DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>& rhs) + { + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + } + + ConstDBIterator& operator=(const ConstDBIterator& rhs) + { + if(_cursor) + { + _cursor->close(); + } + + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + + return *this; + } + + // + // Create const_iterator from iterator. + // + ConstDBIterator& operator=(const DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>& rhs) + { + if(_cursor) + { + _cursor->close(); + } + + if(rhs._cursor) + { + _cursor = rhs._cursor->clone(); + } + + _db = rhs._db; + + return *this; + } + + ~ConstDBIterator() + { + if(_cursor) + { + _cursor->close(); + } + } + + bool operator==(const ConstDBIterator& rhs) + { + if(!_db && !rhs._db) + { + return true; + } + return false; + } + + bool operator!=(const ConstDBIterator& rhs) + { + return !(*this == rhs); + } + + ConstDBIterator& operator++() + { + incr(); + return *this; + } + + ConstDBIterator operator++(int) + { + ConstDBIterator tmp = *this; + tmp.incr(); + return tmp; + } + + // + // Note that this doesn't follow the regular iterator mapping: + // + // value_type operator*() const + // + value_type& operator*() const + { + key_type key; + mapped_type value; + + getCurrentValue(key, value); + + // + // !IMPORTANT! + // + // This method has to cache the returned value to implement + // operator->(). + // + const_cast<key_type&>(_ref.first) = key; + const_cast<mapped_type&>(_ref.second) = value; + return _ref; + } + + pointer operator->() const { return &(operator*()); } + +private: + + void incr() + { + assert(_cursor); + if(!_cursor->next()) + { + // + // The iterator has been moved past the end, and is now + // invalid. + // + _cursor->close(); + _cursor = 0; + _db = 0; + } + } + + void getCurrentValue(key_type& key, mapped_type& value) const + { + Freeze::Key k; + Freeze::Value v; + + _cursor->curr(k, v); + + ::Ice::CommunicatorPtr communicator = _db->getCommunicator(); + KeyCodec::read(key, k, communicator); + ValueCodec::read(value, v, communicator); + } + + friend class DBMap<key_type, mapped_type, KeyCodec, ValueCodec>; + + DBPtr _db; + DBCursorPtr _cursor; + + // + // Cached last return value. This is so that operator->() can + // actually return a pointer. + // + mutable value_type _ref; +}; + +// +// This is an STL container that matches the requirements of a +// Associated Container - with the restriction that operator[] isn't +// implemented. It also supports the same interface as a Hashed +// Associative Container (with the above restrictions), except the +// hasher & key_equal methods. +// +// TODO: If necessary it would be possible to implement reverse and +// bidirectional iterators. +// +template <typename key_type, typename mapped_type, typename KeyCodec, typename ValueCodec> +class DBMap +{ +public: + + typedef std::pair<const key_type, const mapped_type> value_type; + + // + // These are not supported: + // + // hasher, key_equal, key_compare, value_compare + // + + typedef DBIterator<key_type, mapped_type, KeyCodec, ValueCodec > iterator; + typedef ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec > const_iterator; + + // + // No definition for reference, const_reference, pointer or + // const_pointer. + // + + typedef size_t size_type; + typedef ptrdiff_t difference_type; + + // + // Allocators are not supported. + // + // allocator_type + // + + // + // Constructors + // + DBMap(const DBPtr& db) : + _db(db) + { + } + +#ifdef __STL_MEMBER_TEMPLATES + template <class _InputIterator> + DBMap(const DBPtr& db, _InputIterator first, _InputIterator last) : + _db(db) + { + while(first != last) + { + insert(*first); + ++first; + } + } +#else + DBMap(const DBPtr& db, const value_type* first, const value_type* last) : + _db(db) + { + while(first != last) + { + insert(*first); + ++first; + } + } + DBMap(const DBPtr& db, const_iterator first, const_iterator last) : + _db(db) + { + while(first != last) + { + insert(*first); + ++first; + } + } +#endif /*__STL_MEMBER_TEMPLATES */ + + ~DBMap() + { + } + + // + // Neither of these operations are supported. + // + // key_compare key_comp() const, value_compare value_comp() const, + // hasher hash_funct() const, key_equal key_eq() const + // + + bool operator==(const DBMap& rhs) const + { + // + // This does a memberwise equality for the entire contents of + // the database. While slow this is always correct. Database + // equality is not necessarily correct in the context of a + // transaction. + // + if(count() != rhs.count()) + return false; + + for(const_iterator p = rhs.begin() ; p != rhs.end() ; ++p) + { + const_iterator q = rhs.find(p->first); + if(q == rhs.end()) + { + return false; + } + if(p->second != q->second) + { + return false; + } + } + return true; + } + + bool operator!=(const DBMap& rhs) const + { + return !(*this == rhs); + } + + void swap(DBMap& rhs) + { + DBPtr tmp = _db; + _db = rhs._db; + rhs._db = tmp; + } + + iterator begin() + { + try + { + return iterator(_db, _db->getCursor()); + } + catch(const DBNotFoundException&) + { + return iterator(); + } + } + const_iterator begin() const + { + try + { + return const_iterator(_db, _db->getCursor()); + } + catch(const DBNotFoundException&) + { + return const_iterator(); + } + } + + iterator end() + { + return iterator(); + } + + const_iterator end() const + { + return const_iterator(); + } + + bool empty() const + { + return size() == 0; + } + + size_type size() const + { + return (size_type)_db->getNumberOfRecords(); + } + + size_type max_size() const + { + return 0xffffffff; // TODO: is this the max? + } + + // + // This method isn't implemented. + // + // mapped_type& operator[](const key_type& key) + // + + // + // This method isn't in the STLport library - but it's referenced + // in "STL Tutorial and Refrence Guide, Second Edition". It's not + // currently implemented. + // + // const mapped_type& operator[](const key_type& key) const; + // + + // + // No allocators. + // + //allocator_type get_allocator() const; + // + + iterator insert(iterator /*position*/, const value_type& key) + { + // + // position is ignored. + // + ::Ice::CommunicatorPtr communicator = _db->getCommunicator(); + + Freeze::Key k; + Freeze::Value v; + KeyCodec::write(key.first, k, communicator); + ValueCodec::write(key.second, v, communicator); + + _db->put(k, v); + DBCursorPtr cursor = _db->getCursorAtKey(k); + + return iterator(_db, cursor); + } + + std::pair<iterator, bool> insert(const value_type& key) + { + ::Ice::CommunicatorPtr communicator = _db->getCommunicator(); + + Freeze::Key k; + Freeze::Value v; + KeyCodec::write(key.first, k, communicator); + ValueCodec::write(key.second, v, communicator); + + DBCursorPtr cursor; + bool inserted; + + try + { + // + // Does the value exist already? + // + cursor = _db->getCursorAtKey(k); + inserted = false; + } + catch(const DBNotFoundException&) + { + inserted = true; + } + + _db->put(k, v); + if(inserted) + { + cursor = _db->getCursorAtKey(k); + } + return std::pair<iterator, bool>(iterator(_db, cursor), inserted); + } + +#ifdef __STL_MEMBER_TEMPLATES + template <typename InputIterator> + void insert(InputIterator first, InputIterator last) + { + while(first != last) + { + insert(*first); + ++first; + } + } +#else + void insert(const value_type* first, const value_type* last) + { + while(first != last) + { + insert(*first); + ++first; + } + } + void insert(const_iterator first, const_iterator last) + { + while(first != last) + { + insert(*first); + ++first; + } + } +#endif + + void erase(iterator position) + { + position._cursor->del(); + } + + size_type erase(const key_type& key) + { + Freeze::Key k; + KeyCodec::write(key, k, _db->getCommunicator()); + + try + { + _db->del(k); + } + catch(const DBNotFoundException&) + { + return 0; + } + + return 1; + } + + void erase(iterator first, iterator last) + { + while(first != last) + { + first._cursor->del(); + ++first; + } + } + + void clear() + { + _db->clear(); + } + + iterator find(const key_type& key) + { + Freeze::Key k; + KeyCodec::write(key, k, _db->getCommunicator()); + + try + { + DBCursorPtr cursor = _db->getCursorAtKey(k); + return iterator(_db, cursor); + } + catch(const DBNotFoundException&) + { + // + // The record doesn't exist, return the end() iterator. + // + } + return end(); + } + + const_iterator find(const key_type& key) const + { + Freeze::Key k; + KeyCodec::write(key, k, _db->getCommunicator()); + + try + { + DBCursorPtr cursor = _db->getCursorAtKey(k); + return const_iterator(_db, cursor); + } + catch(const DBNotFoundException&) + { + // + // The record doesn't exist, return the end() iterator. + // + } + return end(); + } + + size_type count(const key_type& key) const + { + if(find(key) != end()) + return 1; + return 0; + } + + std::pair<iterator, iterator> equal_range(const key_type& key) + { + iterator p = find(key); + return std::pair<iterator,iterator>(p,p); + } + + std::pair<const_iterator, const_iterator> equal_range(const key_type& key) const + { + const_iterator p = find(key); + return std::pair<const_iterator,const_iterator>(p,p); + } + +private: + + DBPtr _db; +}; + +} // End namespace Freeze + +// +// This is for MSVC. +// +# ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES +namespace std +{ + +//XXX update +template <class key_type, class mapped_type, class KeyCodec, class ValueCodec> +inline pair<const key_type, const mapped_type>* +value_type(const Freeze::DBIterator<key_type, mapped_type, KeyCodec, ValueCodec>&) +{ + return (pair<const key_type, const mapped_type>*)0; +} + +template <class key_type, class mapped_type, class KeyCodec, class ValueCodec> +inline pair<const key_type, const mapped_type>* +value_type(const Freeze::ConstDBIterator<key_type, mapped_type, KeyCodec, ValueCodec>&) +{ + return (pair<const key_type, const mapped_type>*)0; +} + +inline forward_iterator_tag iterator_category(const Freeze::DBIteratorBase&) +{ + return forward_iterator_tag(); +} + +inline ptrdiff_t* distance_type(const Freeze::DBIteratorBase&) { return (ptrdiff_t*) 0; } + +} // End namespace std + +#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ + +#endif diff --git a/cpp/include/Glacier/Glacier.h b/cpp/include/Glacier/Glacier.h index 1732ba70ff5..ac1e0426a34 100644 --- a/cpp/include/Glacier/Glacier.h +++ b/cpp/include/Glacier/Glacier.h @@ -1,18 +1,18 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GLACIER_H
-#define GLACIER_H
-
-#include <Glacier/Starter.h>
-#include <Glacier/Session.h>
-#include <Glacier/SessionManager.h>
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GLACIER_H +#define GLACIER_H + +#include <Glacier/Starter.h> +#include <Glacier/Session.h> +#include <Glacier/SessionManager.h> + +#endif diff --git a/cpp/include/Ice/Application.h b/cpp/include/Ice/Application.h index d7714c20906..124dec9b4bb 100644 --- a/cpp/include/Ice/Application.h +++ b/cpp/include/Ice/Application.h @@ -1,70 +1,70 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_APPLICATION_H
-#define ICE_APPLICATION_H
-
-#include <Ice/Ice.h>
-
-namespace Ice
-{
-
-class ICE_API Application : public IceUtil::noncopyable
-{
-public:
-
- Application();
- virtual ~Application();
-
- //
- // This main() must be called by the global main(). main()
- // initializes the Communicator, calls run() as a template method,
- // and destroys the Communicator upon return from run(). It
- // thereby handles all exceptions properly, i.e., error messages
- // are printed if exceptions propagate to main(), and the
- // Communicator is always destroyed, regardless of exceptions.
- //
- int main(int, char*[], const char* = 0);
- virtual int run(int, char*[]) = 0;
-
- //
- // Return the application name, i.e., argv[0].
- //
- static const char* appName();
-
- //
- // One limitation of this class is that there can only be one
- // Application instance, with one global Communicator, accessible
- // with this communicator() operation. This limitiation is due to
- // how the signal handling functions below operate. If you require
- // multiple Communicators, then you cannot use this Application
- // framework class.
- //
- static CommunicatorPtr communicator();
-
- //
- // These methods can be used to set a signal handler that calls
- // communicator()->shutdown() upon interrupt (to make
- // communicator()->waitForShutdown() return), to ignore
- // interrupts, or to set interrupts back to default behavior.
- //
- static void shutdownOnInterrupt();
- static void ignoreInterrupt();
- static void defaultInterrupt();
-
-private:
-
- static const char* _appName;
- static CommunicatorPtr _communicator;
-};
-
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_APPLICATION_H +#define ICE_APPLICATION_H + +#include <Ice/Ice.h> + +namespace Ice +{ + +class ICE_API Application : public IceUtil::noncopyable +{ +public: + + Application(); + virtual ~Application(); + + // + // This main() must be called by the global main(). main() + // initializes the Communicator, calls run() as a template method, + // and destroys the Communicator upon return from run(). It + // thereby handles all exceptions properly, i.e., error messages + // are printed if exceptions propagate to main(), and the + // Communicator is always destroyed, regardless of exceptions. + // + int main(int, char*[], const char* = 0); + virtual int run(int, char*[]) = 0; + + // + // Return the application name, i.e., argv[0]. + // + static const char* appName(); + + // + // One limitation of this class is that there can only be one + // Application instance, with one global Communicator, accessible + // with this communicator() operation. This limitiation is due to + // how the signal handling functions below operate. If you require + // multiple Communicators, then you cannot use this Application + // framework class. + // + static CommunicatorPtr communicator(); + + // + // These methods can be used to set a signal handler that calls + // communicator()->shutdown() upon interrupt (to make + // communicator()->waitForShutdown() return), to ignore + // interrupts, or to set interrupts back to default behavior. + // + static void shutdownOnInterrupt(); + static void ignoreInterrupt(); + static void defaultInterrupt(); + +private: + + static const char* _appName; + static CommunicatorPtr _communicator; +}; + +}; + +#endif diff --git a/cpp/include/Ice/BasicStream.h b/cpp/include/Ice/BasicStream.h index 8c841f8c4ba..155a0c839a9 100644 --- a/cpp/include/Ice/BasicStream.h +++ b/cpp/include/Ice/BasicStream.h @@ -1,145 +1,145 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_STREAM_H
-#define ICE_STREAM_H
-
-#include <Ice/InstanceF.h>
-#include <Ice/ObjectF.h>
-#include <Ice/ProxyF.h>
-#include <Ice/Buffer.h>
-#include <Ice/ObjectFactoryF.h>
-
-namespace Ice
-{
-
-class UserException;
-
-}
-
-namespace IceInternal
-{
-
-class ICE_API BasicStream : public Buffer
-{
-public:
-
- BasicStream(const InstancePtr&);
-
- InstancePtr instance() const;
-
- void swap(BasicStream&);
-
- void resize(int);
- void reserve(int);
-
- void startWriteEncaps();
- void endWriteEncaps();
- void startReadEncaps();
- void endReadEncaps();
- void checkReadEncaps();
- Ice::Int getReadEncapsSize();
- void skipEncaps();
-
- void writeSize(Ice::Int);
- void readSize(Ice::Int&);
-
- void writeBlob(const std::vector<Ice::Byte>&);
- void readBlob(std::vector<Ice::Byte>&, Ice::Int);
-
- // Performance critical function inlined, as writing single bytes
- // is used in many places in Ice code.
- void write(Ice::Byte v)
- {
- b.push_back(v);
- }
- void write(const std::vector<Ice::Byte>&);
- void read(Ice::Byte&);
- void read(std::vector<Ice::Byte>&);
-
- // Performance critical function inlined, as writing single bools
- // is used in many places in Ice code.
- void write(bool v)
- {
- b.push_back(static_cast<Ice::Byte>(v));
- }
- void write(const std::vector<bool>&);
- void read(bool&);
- void read(std::vector<bool>&);
-
- void write(Ice::Short);
- void write(const std::vector<Ice::Short>&);
- void read(Ice::Short&);
- void read(std::vector<Ice::Short>&);
-
- void write(Ice::Int);
- void write(const std::vector<Ice::Int>&);
- void read(Ice::Int&);
- void read(std::vector<Ice::Int>&);
-
- void write(Ice::Long);
- void write(const std::vector<Ice::Long>&);
- void read(Ice::Long&);
- void read(std::vector<Ice::Long>&);
-
- void write(Ice::Float);
- void write(const std::vector<Ice::Float>&);
- void read(Ice::Float&);
- void read(std::vector<Ice::Float>&);
-
- void write(Ice::Double);
- void write(const std::vector<Ice::Double>&);
- void read(Ice::Double&);
- void read(std::vector<Ice::Double>&);
-
- void write(const std::string&);
- void write(const std::vector<std::string>&);
- void read(std::string&);
- void read(std::vector<std::string>&);
-
- void write(const Ice::ObjectPrx&);
- void read(Ice::ObjectPrx&);
-
- void write(const Ice::ObjectPtr&);
- void read(const std::string&, const ::Ice::ObjectFactoryPtr&, Ice::ObjectPtr&);
-
- void write(const Ice::UserException&);
- ::Ice::Int throwException(const std::string*, const std::string*);
-
-private:
-
- //
- // Optimization. The instance may not be deleted while a
- // stack-allocated Incoming still holds it.
- //
- const InstancePtr& _instance;
-
- struct ReadEncaps
- {
- Container::size_type start;
- Ice::Byte encoding;
- std::vector<Ice::ObjectPtr> objectsRead;
- };
-
- struct WriteEncaps
- {
- Container::size_type start;
- std::map<Ice::ObjectPtr, Ice::Int> objectsWritten;
- };
-
- std::vector<ReadEncaps> _readEncapsStack;
- std::vector<WriteEncaps> _writeEncapsStack;
- ReadEncaps* _currentReadEncaps;
- WriteEncaps* _currentWriteEncaps;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_STREAM_H +#define ICE_STREAM_H + +#include <Ice/InstanceF.h> +#include <Ice/ObjectF.h> +#include <Ice/ProxyF.h> +#include <Ice/Buffer.h> +#include <Ice/ObjectFactoryF.h> + +namespace Ice +{ + +class UserException; + +} + +namespace IceInternal +{ + +class ICE_API BasicStream : public Buffer +{ +public: + + BasicStream(const InstancePtr&); + + InstancePtr instance() const; + + void swap(BasicStream&); + + void resize(int); + void reserve(int); + + void startWriteEncaps(); + void endWriteEncaps(); + void startReadEncaps(); + void endReadEncaps(); + void checkReadEncaps(); + Ice::Int getReadEncapsSize(); + void skipEncaps(); + + void writeSize(Ice::Int); + void readSize(Ice::Int&); + + void writeBlob(const std::vector<Ice::Byte>&); + void readBlob(std::vector<Ice::Byte>&, Ice::Int); + + // Performance critical function inlined, as writing single bytes + // is used in many places in Ice code. + void write(Ice::Byte v) + { + b.push_back(v); + } + void write(const std::vector<Ice::Byte>&); + void read(Ice::Byte&); + void read(std::vector<Ice::Byte>&); + + // Performance critical function inlined, as writing single bools + // is used in many places in Ice code. + void write(bool v) + { + b.push_back(static_cast<Ice::Byte>(v)); + } + void write(const std::vector<bool>&); + void read(bool&); + void read(std::vector<bool>&); + + void write(Ice::Short); + void write(const std::vector<Ice::Short>&); + void read(Ice::Short&); + void read(std::vector<Ice::Short>&); + + void write(Ice::Int); + void write(const std::vector<Ice::Int>&); + void read(Ice::Int&); + void read(std::vector<Ice::Int>&); + + void write(Ice::Long); + void write(const std::vector<Ice::Long>&); + void read(Ice::Long&); + void read(std::vector<Ice::Long>&); + + void write(Ice::Float); + void write(const std::vector<Ice::Float>&); + void read(Ice::Float&); + void read(std::vector<Ice::Float>&); + + void write(Ice::Double); + void write(const std::vector<Ice::Double>&); + void read(Ice::Double&); + void read(std::vector<Ice::Double>&); + + void write(const std::string&); + void write(const std::vector<std::string>&); + void read(std::string&); + void read(std::vector<std::string>&); + + void write(const Ice::ObjectPrx&); + void read(Ice::ObjectPrx&); + + void write(const Ice::ObjectPtr&); + void read(const std::string&, const ::Ice::ObjectFactoryPtr&, Ice::ObjectPtr&); + + void write(const Ice::UserException&); + ::Ice::Int throwException(const std::string*, const std::string*); + +private: + + // + // Optimization. The instance may not be deleted while a + // stack-allocated Incoming still holds it. + // + const InstancePtr& _instance; + + struct ReadEncaps + { + Container::size_type start; + Ice::Byte encoding; + std::vector<Ice::ObjectPtr> objectsRead; + }; + + struct WriteEncaps + { + Container::size_type start; + std::map<Ice::ObjectPtr, Ice::Int> objectsWritten; + }; + + std::vector<ReadEncaps> _readEncapsStack; + std::vector<WriteEncaps> _writeEncapsStack; + ReadEncaps* _currentReadEncaps; + WriteEncaps* _currentWriteEncaps; +}; + +} + +#endif diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h index f538283c1f5..a9a93cef5d9 100644 --- a/cpp/include/Ice/Buffer.h +++ b/cpp/include/Ice/Buffer.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_BUFFER_H
-#define ICE_BUFFER_H
-
-#include <Ice/Config.h>
-
-namespace IceInternal
-{
-
-class ICE_API Buffer : public ::IceUtil::noncopyable
-{
-public:
-
- // TODO: Should not be inline, as this is not performance critical.
- Buffer()
- {
- b.reserve(1000);
- i = b.begin();
- }
-
- typedef std::vector<Ice::Byte> Container;
- Container b;
- Container::iterator i;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_BUFFER_H +#define ICE_BUFFER_H + +#include <Ice/Config.h> + +namespace IceInternal +{ + +class ICE_API Buffer : public ::IceUtil::noncopyable +{ +public: + + // TODO: Should not be inline, as this is not performance critical. + Buffer() + { + b.reserve(1000); + i = b.begin(); + } + + typedef std::vector<Ice::Byte> Container; + Container b; + Container::iterator i; +}; + +} + +#endif diff --git a/cpp/include/Ice/Config.h b/cpp/include/Ice/Config.h index 4bf6a85ccc1..2e4eff7d4d2 100644 --- a/cpp/include/Ice/Config.h +++ b/cpp/include/Ice/Config.h @@ -1,106 +1,106 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONFIG_H
-#define ICE_CONFIG_H
-
-#include <IceUtil/Config.h>
-
-//
-// Some include files we need almost everywhere
-//
-#include <cerrno>
-#include <cstdio>
-#include <cstring>
-#include <string>
-#include <vector>
-#include <map>
-
-//
-// Define the Ice and IceInternal namespace, so that we can use the following
-// everywhere in our code:
-//
-// using namespace Ice;
-// using namespace IceInternal;
-//
-namespace Ice
-{
-}
-
-namespace IceInternal
-{
-}
-
-#if defined(_WIN32)
-
-# ifdef ICE_API_EXPORTS
-# define ICE_API __declspec(dllexport)
-# else
-# define ICE_API __declspec(dllimport)
-# endif
-
-# ifdef ICE_PROTOCOL_API_EXPORTS
-# define ICE_PROTOCOL_API __declspec(dllexport)
-# else
-# define ICE_PROTOCOL_API __declspec(dllimport)
-# endif
-
-# include <process.h>
-
-namespace Ice
-{
-
-typedef char Byte;
-typedef short Short;
-typedef int Int;
-typedef __int64 Long;
-typedef float Float;
-typedef double Double;
-
-}
-
-// TODO: Should not be inline, this is not performance critical.
-inline int getSystemErrno() { return GetLastError(); }
-inline int getSocketErrno() { return WSAGetLastError(); }
-inline int getDNSErrno() { return WSAGetLastError(); }
-
-#elif defined(__linux__) && defined(i386)
-
-# include <sys/types.h>
-# include <unistd.h>
-
-# define ICE_API /**/
-# define ICE_PROTOCOL_API /**/
-
-namespace Ice
-{
-
-typedef char Byte;
-typedef short Short;
-typedef int Int;
-typedef long long Long;
-typedef float Float;
-typedef double Double;
-
-}
-
-// TODO: Should not be inline, this is not performance critical.
-inline int getSystemErrno() { return errno; }
-inline int getSocketErrno() { return errno; }
-extern int h_errno;
-inline int getDNSErrno() { return h_errno; }
-
-#else
-
-# error "Unsupported operating system or platform!"
-
-#endif
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONFIG_H +#define ICE_CONFIG_H + +#include <IceUtil/Config.h> + +// +// Some include files we need almost everywhere +// +#include <cerrno> +#include <cstdio> +#include <cstring> +#include <string> +#include <vector> +#include <map> + +// +// Define the Ice and IceInternal namespace, so that we can use the following +// everywhere in our code: +// +// using namespace Ice; +// using namespace IceInternal; +// +namespace Ice +{ +} + +namespace IceInternal +{ +} + +#if defined(_WIN32) + +# ifdef ICE_API_EXPORTS +# define ICE_API __declspec(dllexport) +# else +# define ICE_API __declspec(dllimport) +# endif + +# ifdef ICE_PROTOCOL_API_EXPORTS +# define ICE_PROTOCOL_API __declspec(dllexport) +# else +# define ICE_PROTOCOL_API __declspec(dllimport) +# endif + +# include <process.h> + +namespace Ice +{ + +typedef char Byte; +typedef short Short; +typedef int Int; +typedef __int64 Long; +typedef float Float; +typedef double Double; + +} + +// TODO: Should not be inline, this is not performance critical. +inline int getSystemErrno() { return GetLastError(); } +inline int getSocketErrno() { return WSAGetLastError(); } +inline int getDNSErrno() { return WSAGetLastError(); } + +#elif defined(__linux__) && defined(i386) + +# include <sys/types.h> +# include <unistd.h> + +# define ICE_API /**/ +# define ICE_PROTOCOL_API /**/ + +namespace Ice +{ + +typedef char Byte; +typedef short Short; +typedef int Int; +typedef long long Long; +typedef float Float; +typedef double Double; + +} + +// TODO: Should not be inline, this is not performance critical. +inline int getSystemErrno() { return errno; } +inline int getSocketErrno() { return errno; } +extern int h_errno; +inline int getDNSErrno() { return h_errno; } + +#else + +# error "Unsupported operating system or platform!" + +#endif + +#endif diff --git a/cpp/include/Ice/ConnectionF.h b/cpp/include/Ice/ConnectionF.h index df7e98ec0d8..81e86dd962b 100644 --- a/cpp/include/Ice/ConnectionF.h +++ b/cpp/include/Ice/ConnectionF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTION_F_H
-#define ICE_CONNECTION_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Connection;
-ICE_API void incRef(Connection*);
-ICE_API void decRef(Connection*);
-typedef IceInternal::Handle<Connection> ConnectionPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTION_F_H +#define ICE_CONNECTION_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Connection; +ICE_API void incRef(Connection*); +ICE_API void decRef(Connection*); +typedef IceInternal::Handle<Connection> ConnectionPtr; + +} + +#endif diff --git a/cpp/include/Ice/ConnectionFactoryF.h b/cpp/include/Ice/ConnectionFactoryF.h index b894aa7d8bb..fbc41654338 100644 --- a/cpp/include/Ice/ConnectionFactoryF.h +++ b/cpp/include/Ice/ConnectionFactoryF.h @@ -1,31 +1,31 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTION_FACTORY_F_H
-#define ICE_CONNECTION_FACTORY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class OutgoingConnectionFactory;
-ICE_API void incRef(OutgoingConnectionFactory*);
-ICE_API void decRef(OutgoingConnectionFactory*);
-typedef IceInternal::Handle<OutgoingConnectionFactory> OutgoingConnectionFactoryPtr;
-
-class IncomingConnectionFactory;
-ICE_API void incRef(IncomingConnectionFactory*);
-ICE_API void decRef(IncomingConnectionFactory*);
-typedef IceInternal::Handle<IncomingConnectionFactory> IncomingConnectionFactoryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTION_FACTORY_F_H +#define ICE_CONNECTION_FACTORY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class OutgoingConnectionFactory; +ICE_API void incRef(OutgoingConnectionFactory*); +ICE_API void decRef(OutgoingConnectionFactory*); +typedef IceInternal::Handle<OutgoingConnectionFactory> OutgoingConnectionFactoryPtr; + +class IncomingConnectionFactory; +ICE_API void incRef(IncomingConnectionFactory*); +ICE_API void decRef(IncomingConnectionFactory*); +typedef IceInternal::Handle<IncomingConnectionFactory> IncomingConnectionFactoryPtr; + +} + +#endif diff --git a/cpp/include/Ice/Direct.h b/cpp/include/Ice/Direct.h index ae9a3c500b4..adc532ef524 100644 --- a/cpp/include/Ice/Direct.h +++ b/cpp/include/Ice/Direct.h @@ -1,45 +1,45 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DIRECT_H
-#define ICE_DIRECT_H
-
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/ServantLocatorF.h>
-#include <Ice/ReferenceF.h>
-#include <Ice/ObjectF.h>
-#include <Ice/LocalObjectF.h>
-#include <Ice/Current.h>
-
-namespace IceInternal
-{
-
-class ICE_API Direct : public ::IceUtil::noncopyable
-{
-public:
-
- Direct(const ::Ice::ObjectAdapterPtr&, const ::Ice::Current&);
- ~Direct();
-
- const ::Ice::ObjectPtr& facetServant();
-
-private:
-
- const ::Ice::ObjectAdapterPtr& _adapter;
- ::Ice::Current _current;
- ::Ice::ObjectPtr _servant;
- ::Ice::ObjectPtr _facetServant;
- ::Ice::ServantLocatorPtr _locator;
- ::Ice::LocalObjectPtr _cookie;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DIRECT_H +#define ICE_DIRECT_H + +#include <Ice/ObjectAdapterF.h> +#include <Ice/ServantLocatorF.h> +#include <Ice/ReferenceF.h> +#include <Ice/ObjectF.h> +#include <Ice/LocalObjectF.h> +#include <Ice/Current.h> + +namespace IceInternal +{ + +class ICE_API Direct : public ::IceUtil::noncopyable +{ +public: + + Direct(const ::Ice::ObjectAdapterPtr&, const ::Ice::Current&); + ~Direct(); + + const ::Ice::ObjectPtr& facetServant(); + +private: + + const ::Ice::ObjectAdapterPtr& _adapter; + ::Ice::Current _current; + ::Ice::ObjectPtr _servant; + ::Ice::ObjectPtr _facetServant; + ::Ice::ServantLocatorPtr _locator; + ::Ice::LocalObjectPtr _cookie; +}; + +} + +#endif diff --git a/cpp/include/Ice/DynamicLibrary.h b/cpp/include/Ice/DynamicLibrary.h index fd69f5a4fbd..ac520e2f946 100644 --- a/cpp/include/Ice/DynamicLibrary.h +++ b/cpp/include/Ice/DynamicLibrary.h @@ -1,93 +1,93 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DYNAMIC_LIBRARY_H
-#define ICE_DYNAMIC_LIBRARY_H
-
-#include <Ice/DynamicLibraryF.h>
-#include <IceUtil/Shared.h>
-
-namespace IceInternal
-{
-
-class ICE_API DynamicLibrary : public ::IceUtil::Shared
-{
-public:
-
- DynamicLibrary();
- ~DynamicLibrary();
-
-#ifdef _WIN32
- typedef FARPROC symbol_type;
-#else
- typedef void* symbol_type;
-#endif
-
- //
- // Load an entry point. This is really a convenience function
- // which combines calls to load() and getSymbol(). However,
- // it does add some value.
- //
- // An entry point has the following format:
- //
- // name[,version]:function
- //
- // The name of the library is constructed from the given
- // information. If no version is supplied, the Ice version
- // is used. For example, consider the following entry point:
- //
- // foo:create
- //
- // This would result in libfoo.so.0.0.1 (Unix) and foo001.dll (Windows),
- // where the Ice version is 0.0.1.
- //
- // Now consider this entry point:
- //
- // foo,1.1:create
- //
- // The library names in this case are libfoo.so.1.1 (Unix) and
- // foo11.dll (Windows).
- //
- // On Windows platforms, a 'd' is appended to the version for debug
- // builds.
- //
- // Returns 0 if a failure occurred.
- //
- symbol_type loadEntryPoint(const std::string&);
-
- //
- // Open a library with the given path.
- //
- bool load(const std::string&);
-
- //
- // Retrieve a symbol from the library. Returns 0 if no match is found.
- //
- symbol_type getSymbol(const std::string&);
-
- //
- // Get the error message for the last failure.
- //
- const std::string& getErrorMessage() const;
-
-private:
-
-#ifdef _WIN32
- HINSTANCE _hnd;
-#else
- void* _hnd;
-#endif
-
- std::string _err;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DYNAMIC_LIBRARY_H +#define ICE_DYNAMIC_LIBRARY_H + +#include <Ice/DynamicLibraryF.h> +#include <IceUtil/Shared.h> + +namespace IceInternal +{ + +class ICE_API DynamicLibrary : public ::IceUtil::Shared +{ +public: + + DynamicLibrary(); + ~DynamicLibrary(); + +#ifdef _WIN32 + typedef FARPROC symbol_type; +#else + typedef void* symbol_type; +#endif + + // + // Load an entry point. This is really a convenience function + // which combines calls to load() and getSymbol(). However, + // it does add some value. + // + // An entry point has the following format: + // + // name[,version]:function + // + // The name of the library is constructed from the given + // information. If no version is supplied, the Ice version + // is used. For example, consider the following entry point: + // + // foo:create + // + // This would result in libfoo.so.0.0.1 (Unix) and foo001.dll (Windows), + // where the Ice version is 0.0.1. + // + // Now consider this entry point: + // + // foo,1.1:create + // + // The library names in this case are libfoo.so.1.1 (Unix) and + // foo11.dll (Windows). + // + // On Windows platforms, a 'd' is appended to the version for debug + // builds. + // + // Returns 0 if a failure occurred. + // + symbol_type loadEntryPoint(const std::string&); + + // + // Open a library with the given path. + // + bool load(const std::string&); + + // + // Retrieve a symbol from the library. Returns 0 if no match is found. + // + symbol_type getSymbol(const std::string&); + + // + // Get the error message for the last failure. + // + const std::string& getErrorMessage() const; + +private: + +#ifdef _WIN32 + HINSTANCE _hnd; +#else + void* _hnd; +#endif + + std::string _err; +}; + +} + +#endif diff --git a/cpp/include/Ice/DynamicLibraryF.h b/cpp/include/Ice/DynamicLibraryF.h index 7a992ea0334..56c8e503d95 100644 --- a/cpp/include/Ice/DynamicLibraryF.h +++ b/cpp/include/Ice/DynamicLibraryF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DYNAMIC_LIBRARY_F_H
-#define ICE_DYNAMIC_LIBRARY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class DynamicLibrary;
-ICE_API void incRef(DynamicLibrary*);
-ICE_API void decRef(DynamicLibrary*);
-typedef Handle<DynamicLibrary> DynamicLibraryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DYNAMIC_LIBRARY_F_H +#define ICE_DYNAMIC_LIBRARY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class DynamicLibrary; +ICE_API void incRef(DynamicLibrary*); +ICE_API void decRef(DynamicLibrary*); +typedef Handle<DynamicLibrary> DynamicLibraryPtr; + +} + +#endif diff --git a/cpp/include/Ice/EndpointF.h b/cpp/include/Ice/EndpointF.h index 6a114027b23..2ccebad8c67 100644 --- a/cpp/include/Ice/EndpointF.h +++ b/cpp/include/Ice/EndpointF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_F_H
-#define ICE_ENDPOINT_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Endpoint;
-ICE_PROTOCOL_API void incRef(Endpoint*);
-ICE_PROTOCOL_API void decRef(Endpoint*);
-typedef IceInternal::Handle<Endpoint> EndpointPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_F_H +#define ICE_ENDPOINT_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Endpoint; +ICE_PROTOCOL_API void incRef(Endpoint*); +ICE_PROTOCOL_API void decRef(Endpoint*); +typedef IceInternal::Handle<Endpoint> EndpointPtr; + +} + +#endif diff --git a/cpp/include/Ice/EndpointFactory.h b/cpp/include/Ice/EndpointFactory.h index 9da548d5e9a..43715fc5f29 100644 --- a/cpp/include/Ice/EndpointFactory.h +++ b/cpp/include/Ice/EndpointFactory.h @@ -1,42 +1,42 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_FACTORY_H
-#define ICE_ENDPOINT_FACTORY_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/EndpointF.h>
-#include <Ice/EndpointFactoryF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class ICE_PROTOCOL_API EndpointFactory : public ::IceUtil::Shared
-{
-public:
-
- virtual ~EndpointFactory();
-
- virtual ::Ice::Short type() const = 0;
- virtual const ::std::string& protocol() const = 0;
- virtual EndpointPtr create(const std::string&) const = 0;
- virtual EndpointPtr read(BasicStream*) const = 0;
- virtual void destroy() = 0;
-
-protected:
-
- EndpointFactory();
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_FACTORY_H +#define ICE_ENDPOINT_FACTORY_H + +#include <IceUtil/Shared.h> +#include <Ice/EndpointF.h> +#include <Ice/EndpointFactoryF.h> + +namespace IceInternal +{ + +class BasicStream; + +class ICE_PROTOCOL_API EndpointFactory : public ::IceUtil::Shared +{ +public: + + virtual ~EndpointFactory(); + + virtual ::Ice::Short type() const = 0; + virtual const ::std::string& protocol() const = 0; + virtual EndpointPtr create(const std::string&) const = 0; + virtual EndpointPtr read(BasicStream*) const = 0; + virtual void destroy() = 0; + +protected: + + EndpointFactory(); +}; + +} + +#endif diff --git a/cpp/include/Ice/EndpointFactoryF.h b/cpp/include/Ice/EndpointFactoryF.h index 540745c96ec..11e231e1faa 100644 --- a/cpp/include/Ice/EndpointFactoryF.h +++ b/cpp/include/Ice/EndpointFactoryF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_FACTORY_F_H
-#define ICE_ENDPOINT_FACTORY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class EndpointFactory;
-ICE_PROTOCOL_API void incRef(EndpointFactory*);
-ICE_PROTOCOL_API void decRef(EndpointFactory*);
-typedef Handle<EndpointFactory> EndpointFactoryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_FACTORY_F_H +#define ICE_ENDPOINT_FACTORY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class EndpointFactory; +ICE_PROTOCOL_API void incRef(EndpointFactory*); +ICE_PROTOCOL_API void decRef(EndpointFactory*); +typedef Handle<EndpointFactory> EndpointFactoryPtr; + +} + +#endif diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h index bb2dc1ab114..faff50b3b09 100644 --- a/cpp/include/Ice/Exception.h +++ b/cpp/include/Ice/Exception.h @@ -1,75 +1,75 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_EXCEPTION_H
-#define ICE_EXCEPTION_H
-
-#include <IceUtil/Exception.h>
-#include <Ice/Config.h>
-#include <Ice/Handle.h>
-
-//
-// The manual forward declaration of ::Ice::Stream is necesary since
-// Ice/StreamF.h includes Ice/Exception.h.
-//
-namespace Ice
-{
-
-class Stream;
-
-}
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-ICE_API void incRef(::Ice::Stream*);
-ICE_API void decRef(::Ice::Stream*);
-
-}
-
-namespace Ice
-{
-
-typedef ::IceInternal::Handle< ::Ice::Stream> StreamPtr;
-
-typedef IceUtil::Exception Exception;
-
-class LocalException : public IceUtil::Exception
-{
-public:
-
- ICE_API LocalException(const char*, int);
- virtual std::string ice_name() const = 0;
- virtual Exception* ice_clone() const = 0;
- virtual void ice_throw() const = 0;
-};
-
-class ICE_API UserException : public IceUtil::Exception
-{
-public:
-
- virtual std::string ice_name() const = 0;
- virtual Exception* ice_clone() const = 0;
- virtual void ice_throw() const = 0;
-
- virtual const std::string* __getExceptionIds() const = 0;
- virtual void __write(::IceInternal::BasicStream*) const = 0;
- virtual void __read(::IceInternal::BasicStream*) = 0;
- virtual void __marshal(const StreamPtr&) const = 0;
- virtual void __unmarshal(const StreamPtr&) = 0;
-
- void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_EXCEPTION_H +#define ICE_EXCEPTION_H + +#include <IceUtil/Exception.h> +#include <Ice/Config.h> +#include <Ice/Handle.h> + +// +// The manual forward declaration of ::Ice::Stream is necesary since +// Ice/StreamF.h includes Ice/Exception.h. +// +namespace Ice +{ + +class Stream; + +} + +namespace IceInternal +{ + +class BasicStream; + +ICE_API void incRef(::Ice::Stream*); +ICE_API void decRef(::Ice::Stream*); + +} + +namespace Ice +{ + +typedef ::IceInternal::Handle< ::Ice::Stream> StreamPtr; + +typedef IceUtil::Exception Exception; + +class LocalException : public IceUtil::Exception +{ +public: + + ICE_API LocalException(const char*, int); + virtual std::string ice_name() const = 0; + virtual Exception* ice_clone() const = 0; + virtual void ice_throw() const = 0; +}; + +class ICE_API UserException : public IceUtil::Exception +{ +public: + + virtual std::string ice_name() const = 0; + virtual Exception* ice_clone() const = 0; + virtual void ice_throw() const = 0; + + virtual const std::string* __getExceptionIds() const = 0; + virtual void __write(::IceInternal::BasicStream*) const = 0; + virtual void __read(::IceInternal::BasicStream*) = 0; + virtual void __marshal(const StreamPtr&) const = 0; + virtual void __unmarshal(const StreamPtr&) = 0; + + void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&); +}; + +} + +#endif diff --git a/cpp/include/Ice/Functional.h b/cpp/include/Ice/Functional.h index 624d4858b12..b0db10c30b8 100644 --- a/cpp/include/Ice/Functional.h +++ b/cpp/include/Ice/Functional.h @@ -1,139 +1,139 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_FUNCTIONAL_H
-#define ICE_FUNCTIONAL_H
-
-#include <IceUtil/Functional.h>
-#include <Ice/Handle.h>
-
-// ----------------------------------------------------------------------
-// Inline functions that return function objects that work with
-// IceInternal::Handle
-// ----------------------------------------------------------------------
-
-namespace Ice
-{
-
-template<class R, class T>
-inline ::IceUtilInternal::MemFun<R, T, ::IceInternal::Handle<T> >
-memFun(R (T::*p)(void))
-{
- return ::IceUtilInternal::MemFun<R, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class R, class T, class A>
-inline ::IceUtilInternal::MemFun1<R, T, ::IceInternal::Handle<T>, A>
-memFun1(R (T::*p)(A))
-{
- return ::IceUtilInternal::MemFun1<R, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class T>
-inline ::IceUtilInternal::VoidMemFun<T, ::IceInternal::Handle<T> >
-voidMemFun(void (T::*p)(void))
-{
- return ::IceUtilInternal::VoidMemFun<T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class T, class A>
-inline ::IceUtilInternal::VoidMemFun1<T, ::IceInternal::Handle<T>, A>
-voidMemFun1(void (T::*p)(A))
-{
- return ::IceUtilInternal::VoidMemFun1<T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class R, class K, class T>
-inline ::IceUtilInternal::SecondMemFun<R, K, T, ::IceInternal::Handle<T> >
-secondMemFun(R (T::*p)(void))
-{
- return ::IceUtilInternal::SecondMemFun<R, K, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class R, class K, class T, class A>
-inline ::IceUtilInternal::SecondMemFun1<R, K, T, ::IceInternal::Handle<T>, A>
-secondMemFun1(R (T::*p)(A))
-{
- return ::IceUtilInternal::SecondMemFun1<R, K, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class K, class T>
-inline ::IceUtilInternal::SecondVoidMemFun<K, T, ::IceInternal::Handle<T> >
-secondVoidMemFun(void (T::*p)(void))
-{
- return ::IceUtilInternal::SecondVoidMemFun<K, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class K, class T, class A>
-inline ::IceUtilInternal::SecondVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>
-secondVoidMemFun1(void (T::*p)(A))
-{
- return ::IceUtilInternal::SecondVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class R, class T>
-inline ::IceUtilInternal::ConstMemFun<R, T, ::IceInternal::Handle<T> >
-constMemFun(R (T::*p)(void) const)
-{
- return ::IceUtilInternal::ConstMemFun<R, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class R, class T, class A>
-inline ::IceUtilInternal::ConstMemFun1<R, T, ::IceInternal::Handle<T>, A>
-constMemFun1(R (T::*p)(A) const)
-{
- return ::IceUtilInternal::ConstMemFun1<R, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class T>
-inline ::IceUtilInternal::ConstVoidMemFun<T, ::IceInternal::Handle<T> >
-constVoidMemFun(void (T::*p)(void) const)
-{
- return ::IceUtilInternal::ConstVoidMemFun<T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class T, class A>
-inline ::IceUtilInternal::ConstVoidMemFun1<T, ::IceInternal::Handle<T>, A>
-constVoidMemFun1(void (T::*p)(A) const)
-{
- return ::IceUtilInternal::ConstVoidMemFun1<T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class R, class K, class T>
-inline ::IceUtilInternal::SecondConstMemFun<R, K, T, ::IceInternal::Handle<T> >
-secondConstMemFun(R (T::*p)(void) const)
-{
- return ::IceUtilInternal::SecondConstMemFun<R, K, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class R, class K, class T, class A>
-inline ::IceUtilInternal::SecondConstMemFun1<R, K, T, ::IceInternal::Handle<T>, A>
-secondConstMemFun1(R (T::*p)(A) const)
-{
- return ::IceUtilInternal::SecondConstMemFun1<R, K, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-template<class K, class T>
-inline ::IceUtilInternal::SecondConstVoidMemFun<K, T, ::IceInternal::Handle<T> >
-secondConstVoidMemFun(void (T::*p)(void) const)
-{
- return ::IceUtilInternal::SecondConstVoidMemFun<K, T, ::IceInternal::Handle<T> >(p);
-}
-
-template<class K, class T, class A>
-inline ::IceUtilInternal::SecondConstVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>
-secondConstVoidMemFun1(void (T::*p)(A) const)
-{
- return ::IceUtilInternal::SecondConstVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>(p);
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_FUNCTIONAL_H +#define ICE_FUNCTIONAL_H + +#include <IceUtil/Functional.h> +#include <Ice/Handle.h> + +// ---------------------------------------------------------------------- +// Inline functions that return function objects that work with +// IceInternal::Handle +// ---------------------------------------------------------------------- + +namespace Ice +{ + +template<class R, class T> +inline ::IceUtilInternal::MemFun<R, T, ::IceInternal::Handle<T> > +memFun(R (T::*p)(void)) +{ + return ::IceUtilInternal::MemFun<R, T, ::IceInternal::Handle<T> >(p); +} + +template<class R, class T, class A> +inline ::IceUtilInternal::MemFun1<R, T, ::IceInternal::Handle<T>, A> +memFun1(R (T::*p)(A)) +{ + return ::IceUtilInternal::MemFun1<R, T, ::IceInternal::Handle<T>, A>(p); +} + +template<class T> +inline ::IceUtilInternal::VoidMemFun<T, ::IceInternal::Handle<T> > +voidMemFun(void (T::*p)(void)) +{ + return ::IceUtilInternal::VoidMemFun<T, ::IceInternal::Handle<T> >(p); +} + +template<class T, class A> +inline ::IceUtilInternal::VoidMemFun1<T, ::IceInternal::Handle<T>, A> +voidMemFun1(void (T::*p)(A)) +{ + return ::IceUtilInternal::VoidMemFun1<T, ::IceInternal::Handle<T>, A>(p); +} + +template<class R, class K, class T> +inline ::IceUtilInternal::SecondMemFun<R, K, T, ::IceInternal::Handle<T> > +secondMemFun(R (T::*p)(void)) +{ + return ::IceUtilInternal::SecondMemFun<R, K, T, ::IceInternal::Handle<T> >(p); +} + +template<class R, class K, class T, class A> +inline ::IceUtilInternal::SecondMemFun1<R, K, T, ::IceInternal::Handle<T>, A> +secondMemFun1(R (T::*p)(A)) +{ + return ::IceUtilInternal::SecondMemFun1<R, K, T, ::IceInternal::Handle<T>, A>(p); +} + +template<class K, class T> +inline ::IceUtilInternal::SecondVoidMemFun<K, T, ::IceInternal::Handle<T> > +secondVoidMemFun(void (T::*p)(void)) +{ + return ::IceUtilInternal::SecondVoidMemFun<K, T, ::IceInternal::Handle<T> >(p); +} + +template<class K, class T, class A> +inline ::IceUtilInternal::SecondVoidMemFun1<K, T, ::IceInternal::Handle<T>, A> +secondVoidMemFun1(void (T::*p)(A)) +{ + return ::IceUtilInternal::SecondVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>(p); +} + +template<class R, class T> +inline ::IceUtilInternal::ConstMemFun<R, T, ::IceInternal::Handle<T> > +constMemFun(R (T::*p)(void) const) +{ + return ::IceUtilInternal::ConstMemFun<R, T, ::IceInternal::Handle<T> >(p); +} + +template<class R, class T, class A> +inline ::IceUtilInternal::ConstMemFun1<R, T, ::IceInternal::Handle<T>, A> +constMemFun1(R (T::*p)(A) const) +{ + return ::IceUtilInternal::ConstMemFun1<R, T, ::IceInternal::Handle<T>, A>(p); +} + +template<class T> +inline ::IceUtilInternal::ConstVoidMemFun<T, ::IceInternal::Handle<T> > +constVoidMemFun(void (T::*p)(void) const) +{ + return ::IceUtilInternal::ConstVoidMemFun<T, ::IceInternal::Handle<T> >(p); +} + +template<class T, class A> +inline ::IceUtilInternal::ConstVoidMemFun1<T, ::IceInternal::Handle<T>, A> +constVoidMemFun1(void (T::*p)(A) const) +{ + return ::IceUtilInternal::ConstVoidMemFun1<T, ::IceInternal::Handle<T>, A>(p); +} + +template<class R, class K, class T> +inline ::IceUtilInternal::SecondConstMemFun<R, K, T, ::IceInternal::Handle<T> > +secondConstMemFun(R (T::*p)(void) const) +{ + return ::IceUtilInternal::SecondConstMemFun<R, K, T, ::IceInternal::Handle<T> >(p); +} + +template<class R, class K, class T, class A> +inline ::IceUtilInternal::SecondConstMemFun1<R, K, T, ::IceInternal::Handle<T>, A> +secondConstMemFun1(R (T::*p)(A) const) +{ + return ::IceUtilInternal::SecondConstMemFun1<R, K, T, ::IceInternal::Handle<T>, A>(p); +} + +template<class K, class T> +inline ::IceUtilInternal::SecondConstVoidMemFun<K, T, ::IceInternal::Handle<T> > +secondConstVoidMemFun(void (T::*p)(void) const) +{ + return ::IceUtilInternal::SecondConstVoidMemFun<K, T, ::IceInternal::Handle<T> >(p); +} + +template<class K, class T, class A> +inline ::IceUtilInternal::SecondConstVoidMemFun1<K, T, ::IceInternal::Handle<T>, A> +secondConstVoidMemFun1(void (T::*p)(A) const) +{ + return ::IceUtilInternal::SecondConstVoidMemFun1<K, T, ::IceInternal::Handle<T>, A>(p); +} + +} + +#endif diff --git a/cpp/include/Ice/Handle.h b/cpp/include/Ice/Handle.h index 59d0e531f06..323ab423373 100644 --- a/cpp/include/Ice/Handle.h +++ b/cpp/include/Ice/Handle.h @@ -1,190 +1,190 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_HANDLE_H
-#define ICE_HANDLE_H
-
-#include <IceUtil/Handle.h>
-#include <Ice/Config.h>
-
-//
-// "Handle" or "smart pointer" class for classes derived from
-// IceUtil::Shared or IceUtil::SimpleShared.
-//
-// In constrast to IceUtil::Handle, IceInternal::Handle requires the
-// declaration of the two global operations IceInternal::incRef(T*)
-// and IceInternal::decRef(T*). The use of global operations allows
-// this template to be used for types which are declared but not
-// defined, provided that the two above mentioned operations are
-// declared.
-//
-
-namespace IceInternal
-{
-
-template<typename T>
-class Handle : public ::IceUtil::HandleBase<T>
-{
-public:
-
- Handle(T* p = 0)
- {
- _ptr = p;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- template<typename Y>
- Handle(const Handle<Y>& r)
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- template<typename Y>
- Handle(const ::IceUtil::Handle<Y>& r)
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- Handle(const Handle<T>& r)
-#else
- Handle(const Handle& r)
-#endif
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- ~Handle()
- {
- if(_ptr)
- {
- decRef(_ptr);
- }
- }
-
- Handle& operator=(T* p)
- {
- if(_ptr != p)
- {
- if(p)
- {
- incRef(p);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = p;
- }
- return *this;
- }
-
- template<typename Y>
- Handle& operator=(const Handle<Y>& r)
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
- template<typename Y>
- Handle& operator=(const ::IceUtil::Handle<Y>& r)
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- Handle& operator=(const Handle<T>& r)
-#else
- Handle& operator=(const Handle& r)
-#endif
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
- template<class Y>
- static Handle dynamicCast(const ::IceUtil::HandleBase<Y>& r)
- {
- return Handle(dynamic_cast<T*>(r._ptr));
- }
-
- template<class Y>
- static Handle dynamicCast(Y* p)
- {
- return Handle(dynamic_cast<T*>(p));
- }
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_HANDLE_H +#define ICE_HANDLE_H + +#include <IceUtil/Handle.h> +#include <Ice/Config.h> + +// +// "Handle" or "smart pointer" class for classes derived from +// IceUtil::Shared or IceUtil::SimpleShared. +// +// In constrast to IceUtil::Handle, IceInternal::Handle requires the +// declaration of the two global operations IceInternal::incRef(T*) +// and IceInternal::decRef(T*). The use of global operations allows +// this template to be used for types which are declared but not +// defined, provided that the two above mentioned operations are +// declared. +// + +namespace IceInternal +{ + +template<typename T> +class Handle : public ::IceUtil::HandleBase<T> +{ +public: + + Handle(T* p = 0) + { + _ptr = p; + + if(_ptr) + { + incRef(_ptr); + } + } + + template<typename Y> + Handle(const Handle<Y>& r) + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + + template<typename Y> + Handle(const ::IceUtil::Handle<Y>& r) + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + Handle(const Handle<T>& r) +#else + Handle(const Handle& r) +#endif + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + + ~Handle() + { + if(_ptr) + { + decRef(_ptr); + } + } + + Handle& operator=(T* p) + { + if(_ptr != p) + { + if(p) + { + incRef(p); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = p; + } + return *this; + } + + template<typename Y> + Handle& operator=(const Handle<Y>& r) + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + + template<typename Y> + Handle& operator=(const ::IceUtil::Handle<Y>& r) + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + Handle& operator=(const Handle<T>& r) +#else + Handle& operator=(const Handle& r) +#endif + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + + template<class Y> + static Handle dynamicCast(const ::IceUtil::HandleBase<Y>& r) + { + return Handle(dynamic_cast<T*>(r._ptr)); + } + + template<class Y> + static Handle dynamicCast(Y* p) + { + return Handle(dynamic_cast<T*>(p)); + } +}; + +} + +#endif diff --git a/cpp/include/Ice/Ice.h b/cpp/include/Ice/Ice.h index 4f1922dd130..b9912476fcb 100644 --- a/cpp/include/Ice/Ice.h +++ b/cpp/include/Ice/Ice.h @@ -1,30 +1,30 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ICE_H
-#define ICE_ICE_H
-
-#include <Ice/Initialize.h>
-#include <Ice/LocalException.h>
-#include <Ice/Properties.h>
-#include <Ice/Logger.h>
-#include <Ice/LoggerUtil.h>
-#include <Ice/Communicator.h>
-#include <Ice/ObjectFactory.h>
-#include <Ice/UserExceptionFactory.h>
-#include <Ice/ObjectAdapter.h>
-#include <Ice/ServantLocator.h>
-#include <Ice/Proxy.h>
-#include <Ice/Object.h>
-#include <Ice/IdentityUtil.h>
-
-//#include <Ice/Stream.h>
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ICE_H +#define ICE_ICE_H + +#include <Ice/Initialize.h> +#include <Ice/LocalException.h> +#include <Ice/Properties.h> +#include <Ice/Logger.h> +#include <Ice/LoggerUtil.h> +#include <Ice/Communicator.h> +#include <Ice/ObjectFactory.h> +#include <Ice/UserExceptionFactory.h> +#include <Ice/ObjectAdapter.h> +#include <Ice/ServantLocator.h> +#include <Ice/Proxy.h> +#include <Ice/Object.h> +#include <Ice/IdentityUtil.h> + +//#include <Ice/Stream.h> + +#endif diff --git a/cpp/include/Ice/IdentityUtil.h b/cpp/include/Ice/IdentityUtil.h index 01620c53b7f..5706aa9df90 100644 --- a/cpp/include/Ice/IdentityUtil.h +++ b/cpp/include/Ice/IdentityUtil.h @@ -1,25 +1,25 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_IDENTITY_UTIL_H
-#define ICE_IDENTITY_UTIL_H
-
-#include <Ice/Identity.h>
-
-namespace Ice
-{
-
-ICE_API std::ostream& operator<<(std::ostream&, const Identity&);
-ICE_API Identity stringToIdentity(const std::string&);
-ICE_API std::string identityToString(const Identity&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_IDENTITY_UTIL_H +#define ICE_IDENTITY_UTIL_H + +#include <Ice/Identity.h> + +namespace Ice +{ + +ICE_API std::ostream& operator<<(std::ostream&, const Identity&); +ICE_API Identity stringToIdentity(const std::string&); +ICE_API std::string identityToString(const Identity&); + +} + +#endif diff --git a/cpp/include/Ice/Incoming.h b/cpp/include/Ice/Incoming.h index 8e8322b0fb3..851115c16cc 100644 --- a/cpp/include/Ice/Incoming.h +++ b/cpp/include/Ice/Incoming.h @@ -1,46 +1,46 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_INCOMING_H
-#define ICE_INCOMING_H
-
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/BasicStream.h>
-
-namespace IceInternal
-{
-
-class ICE_API Incoming : public ::IceUtil::noncopyable
-{
-public:
-
- Incoming(const InstancePtr&, const ::Ice::ObjectAdapterPtr&);
-
- void invoke(bool);
-
- BasicStream* is();
- BasicStream* os();
-
-private:
-
- //
- // Optimization. The adapter may not be deleted while a
- // stack-allocated Incoming still holds it.
- //
- const ::Ice::ObjectAdapterPtr& _adapter;
-
- BasicStream _is;
- BasicStream _os;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_INCOMING_H +#define ICE_INCOMING_H + +#include <Ice/ObjectAdapterF.h> +#include <Ice/InstanceF.h> +#include <Ice/BasicStream.h> + +namespace IceInternal +{ + +class ICE_API Incoming : public ::IceUtil::noncopyable +{ +public: + + Incoming(const InstancePtr&, const ::Ice::ObjectAdapterPtr&); + + void invoke(bool); + + BasicStream* is(); + BasicStream* os(); + +private: + + // + // Optimization. The adapter may not be deleted while a + // stack-allocated Incoming still holds it. + // + const ::Ice::ObjectAdapterPtr& _adapter; + + BasicStream _is; + BasicStream _os; +}; + +} + +#endif diff --git a/cpp/include/Ice/Initialize.h b/cpp/include/Ice/Initialize.h index c2f956b55c9..2b8b8f7dcab 100644 --- a/cpp/include/Ice/Initialize.h +++ b/cpp/include/Ice/Initialize.h @@ -1,56 +1,56 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_INITIALIZE_H
-#define ICE_INITIALIZE_H
-
-#include <Ice/CommunicatorF.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/BuiltinSequences.h>
-
-namespace Ice
-{
-
-ICE_API CommunicatorPtr initialize(int&, char*[], Int = ICE_INT_VERSION);
-ICE_API CommunicatorPtr initializeWithProperties(int&, char*[], const PropertiesPtr&, Int = ICE_INT_VERSION);
-
-ICE_API PropertiesPtr getDefaultProperties();
-ICE_API PropertiesPtr getDefaultProperties(StringSeq&);
-ICE_API PropertiesPtr getDefaultProperties(int&, char*[]);
-
-ICE_API PropertiesPtr createProperties();
-ICE_API PropertiesPtr createProperties(StringSeq&);
-ICE_API PropertiesPtr createProperties(int&, char*[]);
-
-ICE_API StringSeq argsToStringSeq(int, char*[]);
-//
-// This function assumes that the string sequence only contains
-// elements of the argument vector. The function shifts the
-// the argument vector elements so that the vector matches the
-// contents of the sequence.
-//
-ICE_API void stringSeqToArgs(const StringSeq&, int&, char*[]);
-
-}
-
-namespace IceInternal
-{
-
-//
-// Some Ice extensions need access to the Ice internal instance. Do
-// not use this operation for regular application code! It is intended
-// to be used by modules such as Freeze.
-//
-ICE_API InstancePtr getInstance(const ::Ice::CommunicatorPtr&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_INITIALIZE_H +#define ICE_INITIALIZE_H + +#include <Ice/CommunicatorF.h> +#include <Ice/PropertiesF.h> +#include <Ice/InstanceF.h> +#include <Ice/BuiltinSequences.h> + +namespace Ice +{ + +ICE_API CommunicatorPtr initialize(int&, char*[], Int = ICE_INT_VERSION); +ICE_API CommunicatorPtr initializeWithProperties(int&, char*[], const PropertiesPtr&, Int = ICE_INT_VERSION); + +ICE_API PropertiesPtr getDefaultProperties(); +ICE_API PropertiesPtr getDefaultProperties(StringSeq&); +ICE_API PropertiesPtr getDefaultProperties(int&, char*[]); + +ICE_API PropertiesPtr createProperties(); +ICE_API PropertiesPtr createProperties(StringSeq&); +ICE_API PropertiesPtr createProperties(int&, char*[]); + +ICE_API StringSeq argsToStringSeq(int, char*[]); +// +// This function assumes that the string sequence only contains +// elements of the argument vector. The function shifts the +// the argument vector elements so that the vector matches the +// contents of the sequence. +// +ICE_API void stringSeqToArgs(const StringSeq&, int&, char*[]); + +} + +namespace IceInternal +{ + +// +// Some Ice extensions need access to the Ice internal instance. Do +// not use this operation for regular application code! It is intended +// to be used by modules such as Freeze. +// +ICE_API InstancePtr getInstance(const ::Ice::CommunicatorPtr&); + +} + +#endif diff --git a/cpp/include/Ice/InstanceF.h b/cpp/include/Ice/InstanceF.h index d276f7ecd4b..cbb6f1c5789 100644 --- a/cpp/include/Ice/InstanceF.h +++ b/cpp/include/Ice/InstanceF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_INSTANCE_F_H
-#define ICE_INSTANCE_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Instance;
-ICE_API void incRef(Instance*);
-ICE_API void decRef(Instance*);
-typedef IceInternal::Handle<Instance> InstancePtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_INSTANCE_F_H +#define ICE_INSTANCE_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Instance; +ICE_API void incRef(Instance*); +ICE_API void decRef(Instance*); +typedef IceInternal::Handle<Instance> InstancePtr; + +} + +#endif diff --git a/cpp/include/Ice/LocalObject.h b/cpp/include/Ice/LocalObject.h index 057dc8aca31..d2989ffbf9c 100644 --- a/cpp/include/Ice/LocalObject.h +++ b/cpp/include/Ice/LocalObject.h @@ -1,40 +1,40 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_LOCAL_OBJECT_H
-#define ICE_LOCAL_OBJECT_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/LocalObjectF.h>
-#include <Ice/StreamF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-}
-
-namespace Ice
-{
-
-class ICE_API LocalObject : virtual public ::IceUtil::Shared
-{
-public:
-
- virtual bool operator==(const LocalObject&) const;
- virtual bool operator!=(const LocalObject&) const;
- virtual bool operator<(const LocalObject&) const;
- virtual ::Ice::Int ice_hash() const;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_LOCAL_OBJECT_H +#define ICE_LOCAL_OBJECT_H + +#include <IceUtil/Shared.h> +#include <Ice/LocalObjectF.h> +#include <Ice/StreamF.h> + +namespace IceInternal +{ + +class BasicStream; + +} + +namespace Ice +{ + +class ICE_API LocalObject : virtual public ::IceUtil::Shared +{ +public: + + virtual bool operator==(const LocalObject&) const; + virtual bool operator!=(const LocalObject&) const; + virtual bool operator<(const LocalObject&) const; + virtual ::Ice::Int ice_hash() const; +}; + +} + +#endif diff --git a/cpp/include/Ice/LocalObjectF.h b/cpp/include/Ice/LocalObjectF.h index 121743b0b62..a6be07fdefd 100644 --- a/cpp/include/Ice/LocalObjectF.h +++ b/cpp/include/Ice/LocalObjectF.h @@ -1,38 +1,38 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_LOCAL_OBJECT_F_H
-#define ICE_LOCAL_OBJECT_F_H
-
-#include <Ice/Handle.h>
-
-namespace Ice
-{
-
-class LocalObject;
-
-}
-
-namespace IceInternal
-{
-
-ICE_API void incRef(::Ice::LocalObject*);
-ICE_API void decRef(::Ice::LocalObject*);
-
-}
-
-namespace Ice
-{
-
-typedef IceInternal::Handle< LocalObject > LocalObjectPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_LOCAL_OBJECT_F_H +#define ICE_LOCAL_OBJECT_F_H + +#include <Ice/Handle.h> + +namespace Ice +{ + +class LocalObject; + +} + +namespace IceInternal +{ + +ICE_API void incRef(::Ice::LocalObject*); +ICE_API void decRef(::Ice::LocalObject*); + +} + +namespace Ice +{ + +typedef IceInternal::Handle< LocalObject > LocalObjectPtr; + +} + +#endif diff --git a/cpp/include/Ice/LoggerUtil.h b/cpp/include/Ice/LoggerUtil.h index c1b9a8c53b9..1444112da5c 100644 --- a/cpp/include/Ice/LoggerUtil.h +++ b/cpp/include/Ice/LoggerUtil.h @@ -1,103 +1,103 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_LOGGER_UTIL_H
-#define ICE_LOGGER_UTIL_H
-
-#include <Ice/LoggerF.h>
-
-namespace Ice
-{
-
-class ICE_API Warning : public IceUtil::noncopyable
-{
-public:
-
- Warning(const LoggerPtr&);
- ~Warning();
-
- void flush();
-
- std::ostringstream& __str(); // For internal use only. Don't use in your code.
-
-private:
-
- LoggerPtr _logger;
- std::ostringstream _str;
-};
-
-template<typename T>
-Warning&
-operator<<(Warning& out, const T& val)
-{
- out.__str() << val;
- return out;
-}
-
-ICE_API Warning& operator<<(Warning&, std::ios_base& (*)(std::ios_base&));
-
-class ICE_API Error : public IceUtil::noncopyable
-{
-public:
-
- Error(const LoggerPtr&);
- ~Error();
-
- void flush();
-
- std::ostringstream& __str(); // For internal use only. Don't use in your code.
-
-private:
-
- LoggerPtr _logger;
- std::ostringstream _str;
-};
-
-template<typename T>
-Error&
-operator<<(Error& out, const T& val)
-{
- out.__str() << val;
- return out;
-}
-
-ICE_API Error& operator<<(Error&, std::ios_base& (*)(std::ios_base&));
-
-class ICE_API Trace : public IceUtil::noncopyable
-{
-public:
-
- Trace(const LoggerPtr&, const std::string&);
- ~Trace();
-
- void flush();
-
- std::ostringstream& __str(); // For internal use only. Don't use in your code.
-
-private:
-
- LoggerPtr _logger;
- std::string _category;
- std::ostringstream _str;
-};
-
-template<typename T>
-Trace&
-operator<<(Trace& out, const T& val)
-{
- out.__str() << val;
- return out;
-}
-
-ICE_API Trace& operator<<(Trace&, std::ios_base& (*)(std::ios_base&));
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_LOGGER_UTIL_H +#define ICE_LOGGER_UTIL_H + +#include <Ice/LoggerF.h> + +namespace Ice +{ + +class ICE_API Warning : public IceUtil::noncopyable +{ +public: + + Warning(const LoggerPtr&); + ~Warning(); + + void flush(); + + std::ostringstream& __str(); // For internal use only. Don't use in your code. + +private: + + LoggerPtr _logger; + std::ostringstream _str; +}; + +template<typename T> +Warning& +operator<<(Warning& out, const T& val) +{ + out.__str() << val; + return out; +} + +ICE_API Warning& operator<<(Warning&, std::ios_base& (*)(std::ios_base&)); + +class ICE_API Error : public IceUtil::noncopyable +{ +public: + + Error(const LoggerPtr&); + ~Error(); + + void flush(); + + std::ostringstream& __str(); // For internal use only. Don't use in your code. + +private: + + LoggerPtr _logger; + std::ostringstream _str; +}; + +template<typename T> +Error& +operator<<(Error& out, const T& val) +{ + out.__str() << val; + return out; +} + +ICE_API Error& operator<<(Error&, std::ios_base& (*)(std::ios_base&)); + +class ICE_API Trace : public IceUtil::noncopyable +{ +public: + + Trace(const LoggerPtr&, const std::string&); + ~Trace(); + + void flush(); + + std::ostringstream& __str(); // For internal use only. Don't use in your code. + +private: + + LoggerPtr _logger; + std::string _category; + std::ostringstream _str; +}; + +template<typename T> +Trace& +operator<<(Trace& out, const T& val) +{ + out.__str() << val; + return out; +} + +ICE_API Trace& operator<<(Trace&, std::ios_base& (*)(std::ios_base&)); + +} + +#endif diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h index 9861f6c8dc9..c21f46e13ff 100644 --- a/cpp/include/Ice/Object.h +++ b/cpp/include/Ice/Object.h @@ -1,124 +1,124 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OBJECT_H
-#define ICE_OBJECT_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ObjectF.h>
-#include <Ice/ProxyF.h>
-#include <Ice/StreamF.h>
-#include <Ice/Current.h>
-
-namespace IceInternal
-{
-
-class Incoming;
-class BasicStream;
-
-enum DispatchStatus
-{
- DispatchOK,
- DispatchUserException,
- DispatchLocationForward,
- DispatchObjectNotExist,
- DispatchFacetNotExist,
- DispatchOperationNotExist,
- DispatchUnknownLocalException,
- DispatchUnknownUserException,
- DispatchUnknownException
-};
-
-}
-
-namespace Ice
-{
-
-class ICE_API LocationForward
-{
-public:
-
- LocationForward(const LocationForward&);
- LocationForward(const ObjectPrx&);
-
-protected:
-
- ObjectPrx _prx;
- friend class ::IceProxy::Ice::Object;
- friend class ::IceInternal::Incoming;
-};
-
-class ICE_API Object : virtual public ::IceUtil::Shared
-{
-public:
-
- Object();
-
- virtual bool operator==(const Object&) const;
- virtual bool operator!=(const Object&) const;
- virtual bool operator<(const Object&) const;
- virtual ::Ice::Int ice_hash() const;
-
- static const ::std::string __ids[];
-
- virtual bool ice_isA(const ::std::string&, const Current& = Current());
- ::IceInternal::DispatchStatus ___ice_isA(::IceInternal::Incoming&, const Current&);
-
- virtual void ice_ping(const Current& = Current());
- ::IceInternal::DispatchStatus ___ice_ping(::IceInternal::Incoming&, const Current&);
-
- virtual ::std::vector< ::std::string> ice_ids(const Current& = Current());
- ::IceInternal::DispatchStatus ___ice_ids(::IceInternal::Incoming&, const Current&);
-
- virtual const ::std::string& ice_id(const Current& = Current());
- ::IceInternal::DispatchStatus ___ice_id(::IceInternal::Incoming&, const Current&);
-
- ::std::vector< ::std::string> ice_facets(const Current& = Current());
- ::IceInternal::DispatchStatus ___ice_facets(::IceInternal::Incoming&, const Current&);
-
- static const ::std::string& ice_staticId();
-
- static ::std::string __all[];
- virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const Current&);
-
- virtual void __write(::IceInternal::BasicStream*) const;
- virtual void __read(::IceInternal::BasicStream*);
-
- virtual void __marshal(const ::Ice::StreamPtr&) const;
- virtual void __unmarshal(const ::Ice::StreamPtr&);
-
- void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&);
- static void ice_unmarshal(const ::std::string&, const ::Ice::StreamPtr&, ObjectPtr&);
-
- void ice_addFacet(const ObjectPtr&, const ::std::string&);
- void ice_removeFacet(const ::std::string&);
- void ice_removeAllFacets();
- ObjectPtr ice_findFacet(const ::std::string&);
-
-private:
-
- std::map<std::string, ObjectPtr> _activeFacetMap;
- std::map<std::string, ObjectPtr>::iterator _activeFacetMapHint;
- ::IceUtil::Mutex _activeFacetMapMutex;
-};
-
-class ICE_API Blobject : virtual public Object
-{
-public:
-
- // Returns true if ok, false if user exception.
- virtual bool ice_invoke(const std::vector<Byte>&, std::vector<Byte>&, const Current&) = 0;
- virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const Current&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OBJECT_H +#define ICE_OBJECT_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ObjectF.h> +#include <Ice/ProxyF.h> +#include <Ice/StreamF.h> +#include <Ice/Current.h> + +namespace IceInternal +{ + +class Incoming; +class BasicStream; + +enum DispatchStatus +{ + DispatchOK, + DispatchUserException, + DispatchLocationForward, + DispatchObjectNotExist, + DispatchFacetNotExist, + DispatchOperationNotExist, + DispatchUnknownLocalException, + DispatchUnknownUserException, + DispatchUnknownException +}; + +} + +namespace Ice +{ + +class ICE_API LocationForward +{ +public: + + LocationForward(const LocationForward&); + LocationForward(const ObjectPrx&); + +protected: + + ObjectPrx _prx; + friend class ::IceProxy::Ice::Object; + friend class ::IceInternal::Incoming; +}; + +class ICE_API Object : virtual public ::IceUtil::Shared +{ +public: + + Object(); + + virtual bool operator==(const Object&) const; + virtual bool operator!=(const Object&) const; + virtual bool operator<(const Object&) const; + virtual ::Ice::Int ice_hash() const; + + static const ::std::string __ids[]; + + virtual bool ice_isA(const ::std::string&, const Current& = Current()); + ::IceInternal::DispatchStatus ___ice_isA(::IceInternal::Incoming&, const Current&); + + virtual void ice_ping(const Current& = Current()); + ::IceInternal::DispatchStatus ___ice_ping(::IceInternal::Incoming&, const Current&); + + virtual ::std::vector< ::std::string> ice_ids(const Current& = Current()); + ::IceInternal::DispatchStatus ___ice_ids(::IceInternal::Incoming&, const Current&); + + virtual const ::std::string& ice_id(const Current& = Current()); + ::IceInternal::DispatchStatus ___ice_id(::IceInternal::Incoming&, const Current&); + + ::std::vector< ::std::string> ice_facets(const Current& = Current()); + ::IceInternal::DispatchStatus ___ice_facets(::IceInternal::Incoming&, const Current&); + + static const ::std::string& ice_staticId(); + + static ::std::string __all[]; + virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const Current&); + + virtual void __write(::IceInternal::BasicStream*) const; + virtual void __read(::IceInternal::BasicStream*); + + virtual void __marshal(const ::Ice::StreamPtr&) const; + virtual void __unmarshal(const ::Ice::StreamPtr&); + + void ice_marshal(const ::std::string&, const ::Ice::StreamPtr&); + static void ice_unmarshal(const ::std::string&, const ::Ice::StreamPtr&, ObjectPtr&); + + void ice_addFacet(const ObjectPtr&, const ::std::string&); + void ice_removeFacet(const ::std::string&); + void ice_removeAllFacets(); + ObjectPtr ice_findFacet(const ::std::string&); + +private: + + std::map<std::string, ObjectPtr> _activeFacetMap; + std::map<std::string, ObjectPtr>::iterator _activeFacetMapHint; + ::IceUtil::Mutex _activeFacetMapMutex; +}; + +class ICE_API Blobject : virtual public Object +{ +public: + + // Returns true if ok, false if user exception. + virtual bool ice_invoke(const std::vector<Byte>&, std::vector<Byte>&, const Current&) = 0; + virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const Current&); +}; + +} + +#endif diff --git a/cpp/include/Ice/ObjectAdapterFactoryF.h b/cpp/include/Ice/ObjectAdapterFactoryF.h index 95c011fc085..4b721d0cd24 100644 --- a/cpp/include/Ice/ObjectAdapterFactoryF.h +++ b/cpp/include/Ice/ObjectAdapterFactoryF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OBJECT_ADAPTER_FACTORY_F_H
-#define ICE_OBJECT_ADAPTER_FACTORY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ObjectAdapterFactory;
-void incRef(ObjectAdapterFactory*);
-void decRef(ObjectAdapterFactory*);
-typedef IceInternal::Handle<ObjectAdapterFactory> ObjectAdapterFactoryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OBJECT_ADAPTER_FACTORY_F_H +#define ICE_OBJECT_ADAPTER_FACTORY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ObjectAdapterFactory; +void incRef(ObjectAdapterFactory*); +void decRef(ObjectAdapterFactory*); +typedef IceInternal::Handle<ObjectAdapterFactory> ObjectAdapterFactoryPtr; + +} + +#endif diff --git a/cpp/include/Ice/ObjectF.h b/cpp/include/Ice/ObjectF.h index 3eb751856d7..c2c3769743d 100644 --- a/cpp/include/Ice/ObjectF.h +++ b/cpp/include/Ice/ObjectF.h @@ -1,38 +1,38 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OBJECT_F_H
-#define ICE_OBJECT_F_H
-
-#include <Ice/Handle.h>
-
-namespace Ice
-{
-
-class Object;
-
-}
-
-namespace IceInternal
-{
-
-ICE_API void incRef(::Ice::Object*);
-ICE_API void decRef(::Ice::Object*);
-
-}
-
-namespace Ice
-{
-
-typedef IceInternal::Handle< Object > ObjectPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OBJECT_F_H +#define ICE_OBJECT_F_H + +#include <Ice/Handle.h> + +namespace Ice +{ + +class Object; + +} + +namespace IceInternal +{ + +ICE_API void incRef(::Ice::Object*); +ICE_API void decRef(::Ice::Object*); + +} + +namespace Ice +{ + +typedef IceInternal::Handle< Object > ObjectPtr; + +} + +#endif diff --git a/cpp/include/Ice/Outgoing.h b/cpp/include/Ice/Outgoing.h index 0d24b505c12..d19e1c27883 100644 --- a/cpp/include/Ice/Outgoing.h +++ b/cpp/include/Ice/Outgoing.h @@ -1,92 +1,92 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OUTGOING_H
-#define ICE_OUTGOING_H
-
-#include <IceUtil/Mutex.h>
-#include <IceUtil/Monitor.h>
-#include <Ice/ConnectionF.h>
-#include <Ice/ReferenceF.h>
-#include <Ice/BasicStream.h>
-#include <Ice/Current.h>
-
-namespace Ice
-{
-
-class LocalException;
-
-}
-
-namespace IceInternal
-{
-
-//
-// An exception wrapper, which is used to indicate that an operation
-// that failed due to an exception is not repeatable if "at-most-once"
-// semantics must be guaranteed.
-//
-class ICE_API NonRepeatable
-{
-public:
-
- NonRepeatable(const NonRepeatable&);
- NonRepeatable(const ::Ice::LocalException&);
- const ::Ice::LocalException* get() const;
-
-private:
-
- const NonRepeatable& operator=(const NonRepeatable&);
-
- std::auto_ptr< ::Ice::LocalException> _ex;
-};
-
-class ICE_API Outgoing : public ::IceUtil::noncopyable, public IceUtil::Monitor< IceUtil::Mutex >
-{
-public:
-
- Outgoing(const ConnectionPtr&, const ReferencePtr&, const std::string&, bool, const ::Ice::Context&);
- ~Outgoing();
-
- bool invoke(); // Returns true if ok, false if user exception.
- void finished(BasicStream&);
- void finished(const ::Ice::LocalException&);
-
- BasicStream* is();
- BasicStream* os();
-
-private:
-
- //
- // Optimization. The connection and the reference may not be deleted
- // while a stack-allocated Incoming still holds it.
- //
- const ConnectionPtr& _connection;
- const ReferencePtr& _reference;
-
- std::auto_ptr< ::Ice::LocalException> _exception;
-
- enum
- {
- StateUnsent,
- StateInProgress,
- StateOK,
- StateLocationForward,
- StateUserException,
- StateLocalException,
- } _state;
-
- BasicStream _is;
- BasicStream _os;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OUTGOING_H +#define ICE_OUTGOING_H + +#include <IceUtil/Mutex.h> +#include <IceUtil/Monitor.h> +#include <Ice/ConnectionF.h> +#include <Ice/ReferenceF.h> +#include <Ice/BasicStream.h> +#include <Ice/Current.h> + +namespace Ice +{ + +class LocalException; + +} + +namespace IceInternal +{ + +// +// An exception wrapper, which is used to indicate that an operation +// that failed due to an exception is not repeatable if "at-most-once" +// semantics must be guaranteed. +// +class ICE_API NonRepeatable +{ +public: + + NonRepeatable(const NonRepeatable&); + NonRepeatable(const ::Ice::LocalException&); + const ::Ice::LocalException* get() const; + +private: + + const NonRepeatable& operator=(const NonRepeatable&); + + std::auto_ptr< ::Ice::LocalException> _ex; +}; + +class ICE_API Outgoing : public ::IceUtil::noncopyable, public IceUtil::Monitor< IceUtil::Mutex > +{ +public: + + Outgoing(const ConnectionPtr&, const ReferencePtr&, const std::string&, bool, const ::Ice::Context&); + ~Outgoing(); + + bool invoke(); // Returns true if ok, false if user exception. + void finished(BasicStream&); + void finished(const ::Ice::LocalException&); + + BasicStream* is(); + BasicStream* os(); + +private: + + // + // Optimization. The connection and the reference may not be deleted + // while a stack-allocated Incoming still holds it. + // + const ConnectionPtr& _connection; + const ReferencePtr& _reference; + + std::auto_ptr< ::Ice::LocalException> _exception; + + enum + { + StateUnsent, + StateInProgress, + StateOK, + StateLocationForward, + StateUserException, + StateLocalException, + } _state; + + BasicStream _is; + BasicStream _os; +}; + +} + +#endif diff --git a/cpp/include/Ice/ProtocolPluginFacade.h b/cpp/include/Ice/ProtocolPluginFacade.h index a9b93a42d7b..243f2c69edc 100644 --- a/cpp/include/Ice/ProtocolPluginFacade.h +++ b/cpp/include/Ice/ProtocolPluginFacade.h @@ -1,70 +1,70 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROTOCOL_PLUGIN_FACADE_H
-#define ICE_PROTOCOL_PLUGIN_FACADE_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/ProtocolPluginFacadeF.h>
-#include <Ice/CommunicatorF.h>
-#include <Ice/EndpointFactoryF.h>
-#include <Ice/InstanceF.h>
-
-namespace IceInternal
-{
-
-//
-// Global function to obtain a ProtocolPluginFacade given a Communicator
-// instance.
-//
-ICE_PROTOCOL_API ProtocolPluginFacadePtr getProtocolPluginFacade(const Ice::CommunicatorPtr&);
-
-//
-// ProtocolPluginFacade wraps the internal operations that protocol
-// plug-ins may need.
-//
-class ICE_PROTOCOL_API ProtocolPluginFacade : public ::IceUtil::Shared
-{
-public:
-
- //
- // Get the Communicator instance with which this facade is
- // associated.
- //
- Ice::CommunicatorPtr getCommunicator() const;
-
- //
- // Get the default hostname to be used in endpoints.
- //
- std::string getDefaultHost() const;
-
- //
- // Get the network trace level and category name.
- //
- int getNetworkTraceLevel() const;
- const char* getNetworkTraceCategory() const;
-
- //
- // Register an EndpointFactory.
- //
- void addEndpointFactory(const EndpointFactoryPtr&) const;
-
-private:
-
- ProtocolPluginFacade(const InstancePtr&);
-
- friend ICE_PROTOCOL_API ProtocolPluginFacadePtr getProtocolPluginFacade(const Ice::CommunicatorPtr&);
-
- InstancePtr _instance;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROTOCOL_PLUGIN_FACADE_H +#define ICE_PROTOCOL_PLUGIN_FACADE_H + +#include <IceUtil/Shared.h> +#include <Ice/ProtocolPluginFacadeF.h> +#include <Ice/CommunicatorF.h> +#include <Ice/EndpointFactoryF.h> +#include <Ice/InstanceF.h> + +namespace IceInternal +{ + +// +// Global function to obtain a ProtocolPluginFacade given a Communicator +// instance. +// +ICE_PROTOCOL_API ProtocolPluginFacadePtr getProtocolPluginFacade(const Ice::CommunicatorPtr&); + +// +// ProtocolPluginFacade wraps the internal operations that protocol +// plug-ins may need. +// +class ICE_PROTOCOL_API ProtocolPluginFacade : public ::IceUtil::Shared +{ +public: + + // + // Get the Communicator instance with which this facade is + // associated. + // + Ice::CommunicatorPtr getCommunicator() const; + + // + // Get the default hostname to be used in endpoints. + // + std::string getDefaultHost() const; + + // + // Get the network trace level and category name. + // + int getNetworkTraceLevel() const; + const char* getNetworkTraceCategory() const; + + // + // Register an EndpointFactory. + // + void addEndpointFactory(const EndpointFactoryPtr&) const; + +private: + + ProtocolPluginFacade(const InstancePtr&); + + friend ICE_PROTOCOL_API ProtocolPluginFacadePtr getProtocolPluginFacade(const Ice::CommunicatorPtr&); + + InstancePtr _instance; +}; + +} + +#endif diff --git a/cpp/include/Ice/ProtocolPluginFacadeF.h b/cpp/include/Ice/ProtocolPluginFacadeF.h index 36321873976..703ee9013fe 100644 --- a/cpp/include/Ice/ProtocolPluginFacadeF.h +++ b/cpp/include/Ice/ProtocolPluginFacadeF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROTOCOL_PLUGIN_FACADE_F_H
-#define ICE_PROTOCOL_PLUGIN_FACADE_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ProtocolPluginFacade;
-ICE_PROTOCOL_API void incRef(ProtocolPluginFacade*);
-ICE_PROTOCOL_API void decRef(ProtocolPluginFacade*);
-typedef Handle<ProtocolPluginFacade> ProtocolPluginFacadePtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROTOCOL_PLUGIN_FACADE_F_H +#define ICE_PROTOCOL_PLUGIN_FACADE_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ProtocolPluginFacade; +ICE_PROTOCOL_API void incRef(ProtocolPluginFacade*); +ICE_PROTOCOL_API void decRef(ProtocolPluginFacade*); +typedef Handle<ProtocolPluginFacade> ProtocolPluginFacadePtr; + +} + +#endif diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index e5b23fd640e..81d438c7391 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -1,208 +1,208 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROXY_H
-#define ICE_PROXY_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ProxyF.h>
-#include <Ice/ProxyFactoryF.h>
-#include <Ice/ConnectionF.h>
-#include <Ice/EndpointF.h>
-#include <Ice/ObjectF.h>
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/ReferenceF.h>
-//#include <Ice/RouterF.h> // Can't include RouterF.h here, otherwise we have cyclic includes
-#include <Ice/Current.h>
-
-namespace IceProxy
-{
-
-namespace Ice
-{
-
-class Router;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-ICE_API void incRef(::IceProxy::Ice::Router*);
-ICE_API void decRef(::IceProxy::Ice::Router*);
-
-ICE_API void checkedCast(const ::Ice::ObjectPrx&, const ::std::string&, ProxyHandle< ::IceProxy::Ice::Router>&);
-ICE_API void uncheckedCast(const ::Ice::ObjectPrx&, const ::std::string&, ProxyHandle< ::IceProxy::Ice::Router>&);
-
-}
-
-namespace Ice
-{
-
-typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::Router> RouterPrx;
-
-class LocalException;
-class LocationForward;
-
-}
-namespace IceProxy { namespace Ice
-{
-
-class ICE_API Object : public ::IceUtil::Shared, ::IceUtil::Mutex
-{
-public:
-
- bool operator==(const Object&) const;
- bool operator!=(const Object&) const;
- bool operator<(const Object&) const;
- ::Ice::Int ice_hash() const;
-
- bool ice_isA(const std::string&, const ::Ice::Context& = ::Ice::Context());
- void ice_ping(const ::Ice::Context& = ::Ice::Context());
- ::std::vector< ::std::string> ice_ids(const ::Ice::Context& = ::Ice::Context());
- ::std::string ice_id(const ::Ice::Context& = ::Ice::Context());
- ::std::vector< ::std::string> ice_facets(const ::Ice::Context& = ::Ice::Context());
- bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&,
- const ::Ice::Context& = ::Ice::Context()); // Returns true if ok, false if user exception.
-
- ::Ice::Identity ice_getIdentity() const;
- ::Ice::ObjectPrx ice_newIdentity(const ::Ice::Identity&) const;
-
- std::string ice_getFacet() const;
- ::Ice::ObjectPrx ice_newFacet(const std::string&) const;
-
- ::Ice::ObjectPrx ice_twoway() const;
- ::Ice::ObjectPrx ice_oneway() const;
- ::Ice::ObjectPrx ice_batchOneway() const;
- ::Ice::ObjectPrx ice_datagram() const;
- ::Ice::ObjectPrx ice_batchDatagram() const;
- ::Ice::ObjectPrx ice_secure(bool) const;
- ::Ice::ObjectPrx ice_compress(bool) const;
- ::Ice::ObjectPrx ice_timeout(int) const;
- ::Ice::ObjectPrx ice_router(const ::Ice::RouterPrx&) const;
- ::Ice::ObjectPrx ice_default() const;
-
- void ice_flush(); // Flush batch messages
-
- ::IceInternal::ReferencePtr __reference() const;
- void __copyFrom(const ::Ice::ObjectPrx&);
- void __handleException(const ::Ice::LocalException&, int&);
- void __rethrowException(const ::Ice::LocalException&);
- void __locationForward(const ::Ice::LocationForward&);
-
- ::IceInternal::Handle< ::IceDelegate::Ice::Object> __getDelegate();
-
-protected:
-
- virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM();
- virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD();
-
-private:
-
- void setup(const ::IceInternal::ReferencePtr&);
- friend class ::IceInternal::ProxyFactory;
-
- ::IceInternal::ReferencePtr _reference;
- ::IceInternal::Handle< ::IceDelegate::Ice::Object> _delegate;
-};
-
-} }
-
-namespace IceDelegate { namespace Ice
-{
-
-class ICE_API Object : public ::IceUtil::Shared
-{
-public:
-
- virtual bool ice_isA(const std::string&, const ::Ice::Context&) = 0;
- virtual void ice_ping(const ::Ice::Context&) = 0;
- virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&) = 0;
- virtual ::std::string ice_id(const ::Ice::Context&) = 0;
- virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&) = 0;
- virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&,
- const ::Ice::Context&) = 0;
- virtual void ice_flush() = 0;
-};
-
-} }
-
-namespace IceDelegateM { namespace Ice
-{
-
-class ICE_API Object : virtual public ::IceDelegate::Ice::Object
-{
-public:
-
- virtual ~Object();
-
- virtual bool ice_isA(const std::string&, const ::Ice::Context&);
- virtual void ice_ping(const ::Ice::Context&);
- virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&);
- virtual ::std::string ice_id(const ::Ice::Context&);
- virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&);
- virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&,
- const ::Ice::Context&);
- virtual void ice_flush();
-
- void __copyFrom(const ::IceInternal::Handle< ::IceDelegateM::Ice::Object>&);
-
-protected:
-
- ::IceInternal::ConnectionPtr __connection;
- ::IceInternal::ReferencePtr __reference;
-
-private:
-
- void setup(const ::IceInternal::ReferencePtr&);
- friend class ::IceProxy::Ice::Object;
-
- std::vector< ::IceInternal::EndpointPtr> filterEndpoints(const std::vector< ::IceInternal::EndpointPtr>&) const;
-};
-
-} }
-
-namespace IceDelegateD { namespace Ice
-{
-
-class ICE_API Object : virtual public ::IceDelegate::Ice::Object
-{
-public:
-
- virtual bool ice_isA(const std::string&, const ::Ice::Context&);
- virtual void ice_ping(const ::Ice::Context&);
- virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&);
- virtual ::std::string ice_id(const ::Ice::Context&);
- virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&);
- virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&,
- const ::Ice::Context&);
- virtual void ice_flush();
-
- void __copyFrom(const ::IceInternal::Handle< ::IceDelegateD::Ice::Object>&);
-
-protected:
-
- ::Ice::ObjectAdapterPtr __adapter;
- ::IceInternal::ReferencePtr __reference;
-
- void __initCurrent(::Ice::Current&, const std::string&, bool, const ::Ice::Context&);
-
-private:
-
- void setup(const ::IceInternal::ReferencePtr&, const ::Ice::ObjectAdapterPtr&);
- friend class ::IceProxy::Ice::Object;
-};
-
-} }
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROXY_H +#define ICE_PROXY_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ProxyF.h> +#include <Ice/ProxyFactoryF.h> +#include <Ice/ConnectionF.h> +#include <Ice/EndpointF.h> +#include <Ice/ObjectF.h> +#include <Ice/ObjectAdapterF.h> +#include <Ice/ReferenceF.h> +//#include <Ice/RouterF.h> // Can't include RouterF.h here, otherwise we have cyclic includes +#include <Ice/Current.h> + +namespace IceProxy +{ + +namespace Ice +{ + +class Router; + +} + +} + +namespace IceInternal +{ + +ICE_API void incRef(::IceProxy::Ice::Router*); +ICE_API void decRef(::IceProxy::Ice::Router*); + +ICE_API void checkedCast(const ::Ice::ObjectPrx&, const ::std::string&, ProxyHandle< ::IceProxy::Ice::Router>&); +ICE_API void uncheckedCast(const ::Ice::ObjectPrx&, const ::std::string&, ProxyHandle< ::IceProxy::Ice::Router>&); + +} + +namespace Ice +{ + +typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::Router> RouterPrx; + +class LocalException; +class LocationForward; + +} +namespace IceProxy { namespace Ice +{ + +class ICE_API Object : public ::IceUtil::Shared, ::IceUtil::Mutex +{ +public: + + bool operator==(const Object&) const; + bool operator!=(const Object&) const; + bool operator<(const Object&) const; + ::Ice::Int ice_hash() const; + + bool ice_isA(const std::string&, const ::Ice::Context& = ::Ice::Context()); + void ice_ping(const ::Ice::Context& = ::Ice::Context()); + ::std::vector< ::std::string> ice_ids(const ::Ice::Context& = ::Ice::Context()); + ::std::string ice_id(const ::Ice::Context& = ::Ice::Context()); + ::std::vector< ::std::string> ice_facets(const ::Ice::Context& = ::Ice::Context()); + bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&, + const ::Ice::Context& = ::Ice::Context()); // Returns true if ok, false if user exception. + + ::Ice::Identity ice_getIdentity() const; + ::Ice::ObjectPrx ice_newIdentity(const ::Ice::Identity&) const; + + std::string ice_getFacet() const; + ::Ice::ObjectPrx ice_newFacet(const std::string&) const; + + ::Ice::ObjectPrx ice_twoway() const; + ::Ice::ObjectPrx ice_oneway() const; + ::Ice::ObjectPrx ice_batchOneway() const; + ::Ice::ObjectPrx ice_datagram() const; + ::Ice::ObjectPrx ice_batchDatagram() const; + ::Ice::ObjectPrx ice_secure(bool) const; + ::Ice::ObjectPrx ice_compress(bool) const; + ::Ice::ObjectPrx ice_timeout(int) const; + ::Ice::ObjectPrx ice_router(const ::Ice::RouterPrx&) const; + ::Ice::ObjectPrx ice_default() const; + + void ice_flush(); // Flush batch messages + + ::IceInternal::ReferencePtr __reference() const; + void __copyFrom(const ::Ice::ObjectPrx&); + void __handleException(const ::Ice::LocalException&, int&); + void __rethrowException(const ::Ice::LocalException&); + void __locationForward(const ::Ice::LocationForward&); + + ::IceInternal::Handle< ::IceDelegate::Ice::Object> __getDelegate(); + +protected: + + virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM(); + virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD(); + +private: + + void setup(const ::IceInternal::ReferencePtr&); + friend class ::IceInternal::ProxyFactory; + + ::IceInternal::ReferencePtr _reference; + ::IceInternal::Handle< ::IceDelegate::Ice::Object> _delegate; +}; + +} } + +namespace IceDelegate { namespace Ice +{ + +class ICE_API Object : public ::IceUtil::Shared +{ +public: + + virtual bool ice_isA(const std::string&, const ::Ice::Context&) = 0; + virtual void ice_ping(const ::Ice::Context&) = 0; + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&) = 0; + virtual ::std::string ice_id(const ::Ice::Context&) = 0; + virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&) = 0; + virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&, + const ::Ice::Context&) = 0; + virtual void ice_flush() = 0; +}; + +} } + +namespace IceDelegateM { namespace Ice +{ + +class ICE_API Object : virtual public ::IceDelegate::Ice::Object +{ +public: + + virtual ~Object(); + + virtual bool ice_isA(const std::string&, const ::Ice::Context&); + virtual void ice_ping(const ::Ice::Context&); + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&); + virtual ::std::string ice_id(const ::Ice::Context&); + virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&); + virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&, + const ::Ice::Context&); + virtual void ice_flush(); + + void __copyFrom(const ::IceInternal::Handle< ::IceDelegateM::Ice::Object>&); + +protected: + + ::IceInternal::ConnectionPtr __connection; + ::IceInternal::ReferencePtr __reference; + +private: + + void setup(const ::IceInternal::ReferencePtr&); + friend class ::IceProxy::Ice::Object; + + std::vector< ::IceInternal::EndpointPtr> filterEndpoints(const std::vector< ::IceInternal::EndpointPtr>&) const; +}; + +} } + +namespace IceDelegateD { namespace Ice +{ + +class ICE_API Object : virtual public ::IceDelegate::Ice::Object +{ +public: + + virtual bool ice_isA(const std::string&, const ::Ice::Context&); + virtual void ice_ping(const ::Ice::Context&); + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context&); + virtual ::std::string ice_id(const ::Ice::Context&); + virtual ::std::vector< ::std::string> ice_facets(const ::Ice::Context&); + virtual bool ice_invoke(const std::string&, bool, const std::vector< ::Ice::Byte>&, std::vector< ::Ice::Byte>&, + const ::Ice::Context&); + virtual void ice_flush(); + + void __copyFrom(const ::IceInternal::Handle< ::IceDelegateD::Ice::Object>&); + +protected: + + ::Ice::ObjectAdapterPtr __adapter; + ::IceInternal::ReferencePtr __reference; + + void __initCurrent(::Ice::Current&, const std::string&, bool, const ::Ice::Context&); + +private: + + void setup(const ::IceInternal::ReferencePtr&, const ::Ice::ObjectAdapterPtr&); + friend class ::IceProxy::Ice::Object; +}; + +} } + +#endif diff --git a/cpp/include/Ice/ProxyF.h b/cpp/include/Ice/ProxyF.h index 1133bee2dbd..ce1496a4bbc 100644 --- a/cpp/include/Ice/ProxyF.h +++ b/cpp/include/Ice/ProxyF.h @@ -1,93 +1,93 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROXY_F_H
-#define ICE_PROXY_F_H
-
-#include <Ice/ProxyHandle.h>
-
-namespace IceProxy
-{
-
-namespace Ice
-{
-
-class Object;
-
-}
-
-}
-
-namespace IceDelegate
-{
-
-namespace Ice
-{
-
-class Object;
-
-}
-
-}
-
-namespace IceDelegateM
-{
-
-namespace Ice
-{
-
-class Object;
-
-}
-
-}
-
-namespace IceDelegateD
-{
-
-namespace Ice
-{
-
-class Object;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-ICE_API void incRef(::IceProxy::Ice::Object*);
-ICE_API void decRef(::IceProxy::Ice::Object*);
-
-ICE_API void incRef(::IceDelegate::Ice::Object*);
-ICE_API void decRef(::IceDelegate::Ice::Object*);
-
-ICE_API void incRef(::IceDelegateM::Ice::Object*);
-ICE_API void decRef(::IceDelegateM::Ice::Object*);
-
-ICE_API void incRef(::IceDelegateD::Ice::Object*);
-ICE_API void decRef(::IceDelegateD::Ice::Object*);
-
-ICE_API void checkedCast(const ProxyHandle< ::IceProxy::Ice::Object>&, const ::std::string&,
- ProxyHandle< ::IceProxy::Ice::Object>&);
-ICE_API void uncheckedCast(const ProxyHandle< ::IceProxy::Ice::Object>&, const ::std::string&,
- ProxyHandle< ::IceProxy::Ice::Object>&);
-
-}
-
-namespace Ice
-{
-
-typedef IceInternal::ProxyHandle< ::IceProxy::Ice::Object> ObjectPrx;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROXY_F_H +#define ICE_PROXY_F_H + +#include <Ice/ProxyHandle.h> + +namespace IceProxy +{ + +namespace Ice +{ + +class Object; + +} + +} + +namespace IceDelegate +{ + +namespace Ice +{ + +class Object; + +} + +} + +namespace IceDelegateM +{ + +namespace Ice +{ + +class Object; + +} + +} + +namespace IceDelegateD +{ + +namespace Ice +{ + +class Object; + +} + +} + +namespace IceInternal +{ + +ICE_API void incRef(::IceProxy::Ice::Object*); +ICE_API void decRef(::IceProxy::Ice::Object*); + +ICE_API void incRef(::IceDelegate::Ice::Object*); +ICE_API void decRef(::IceDelegate::Ice::Object*); + +ICE_API void incRef(::IceDelegateM::Ice::Object*); +ICE_API void decRef(::IceDelegateM::Ice::Object*); + +ICE_API void incRef(::IceDelegateD::Ice::Object*); +ICE_API void decRef(::IceDelegateD::Ice::Object*); + +ICE_API void checkedCast(const ProxyHandle< ::IceProxy::Ice::Object>&, const ::std::string&, + ProxyHandle< ::IceProxy::Ice::Object>&); +ICE_API void uncheckedCast(const ProxyHandle< ::IceProxy::Ice::Object>&, const ::std::string&, + ProxyHandle< ::IceProxy::Ice::Object>&); + +} + +namespace Ice +{ + +typedef IceInternal::ProxyHandle< ::IceProxy::Ice::Object> ObjectPrx; + +} + +#endif diff --git a/cpp/include/Ice/ProxyFactoryF.h b/cpp/include/Ice/ProxyFactoryF.h index 0c5fdfe6ba0..2bf9c138927 100644 --- a/cpp/include/Ice/ProxyFactoryF.h +++ b/cpp/include/Ice/ProxyFactoryF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROXY_FACTORY_F_H
-#define ICE_PROXY_FACTORY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ProxyFactory;
-void incRef(ProxyFactory*);
-void decRef(ProxyFactory*);
-typedef IceInternal::Handle<ProxyFactory> ProxyFactoryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROXY_FACTORY_F_H +#define ICE_PROXY_FACTORY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ProxyFactory; +void incRef(ProxyFactory*); +void decRef(ProxyFactory*); +typedef IceInternal::Handle<ProxyFactory> ProxyFactoryPtr; + +} + +#endif diff --git a/cpp/include/Ice/ProxyHandle.h b/cpp/include/Ice/ProxyHandle.h index 686f3224200..97f603cca61 100644 --- a/cpp/include/Ice/ProxyHandle.h +++ b/cpp/include/Ice/ProxyHandle.h @@ -1,187 +1,187 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROXY_HANDLE_H
-#define ICE_PROXY_HANDLE_H
-
-#include <IceUtil/Handle.h>
-#include <Ice/Config.h>
-
-namespace IceInternal
-{
-
-//
-// Like IceInternal::Handle, but specifically for proxies, with
-// support for checkedCast() and uncheckedCast() instead of
-// dynamicCast().
-//
-template<typename T>
-class ProxyHandle : public ::IceUtil::HandleBase<T>
-{
-public:
-
- ProxyHandle(T* p = 0)
- {
- _ptr = p;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- template<typename Y>
- ProxyHandle(const ProxyHandle<Y>& r)
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- template<typename Y>
- ProxyHandle(const ::IceUtil::Handle<Y>& r)
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- ProxyHandle(const ProxyHandle<T>& r)
-#else
- ProxyHandle(const ProxyHandle& r)
-#endif
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- incRef(_ptr);
- }
- }
-
- ~ProxyHandle()
- {
- if(_ptr)
- {
- decRef(_ptr);
- }
- }
-
- ProxyHandle& operator=(T* p)
- {
- if(_ptr != p)
- {
- if(p)
- {
- incRef(p);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = p;
- }
- return *this;
- }
-
- template<typename Y>
- ProxyHandle& operator=(const ProxyHandle<Y>& r)
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
- template<typename Y>
- ProxyHandle& operator=(const ::IceUtil::Handle<Y>& r)
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- ProxyHandle& operator=(const ProxyHandle<T>& r)
-#else
- ProxyHandle& operator=(const ProxyHandle& r)
-#endif
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- incRef(r._ptr);
- }
-
- if(_ptr)
- {
- decRef(_ptr);
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
- template<class Y>
- static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f = "")
- {
- ProxyHandle p;
- ::IceInternal::checkedCast(r, f, p);
- return p;
- }
-
- template<class Y>
- static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r, const std::string& f = "")
- {
- ProxyHandle p;
- ::IceInternal::uncheckedCast(r, f, p);
- return p;
- }
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROXY_HANDLE_H +#define ICE_PROXY_HANDLE_H + +#include <IceUtil/Handle.h> +#include <Ice/Config.h> + +namespace IceInternal +{ + +// +// Like IceInternal::Handle, but specifically for proxies, with +// support for checkedCast() and uncheckedCast() instead of +// dynamicCast(). +// +template<typename T> +class ProxyHandle : public ::IceUtil::HandleBase<T> +{ +public: + + ProxyHandle(T* p = 0) + { + _ptr = p; + + if(_ptr) + { + incRef(_ptr); + } + } + + template<typename Y> + ProxyHandle(const ProxyHandle<Y>& r) + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + + template<typename Y> + ProxyHandle(const ::IceUtil::Handle<Y>& r) + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + ProxyHandle(const ProxyHandle<T>& r) +#else + ProxyHandle(const ProxyHandle& r) +#endif + { + _ptr = r._ptr; + + if(_ptr) + { + incRef(_ptr); + } + } + + ~ProxyHandle() + { + if(_ptr) + { + decRef(_ptr); + } + } + + ProxyHandle& operator=(T* p) + { + if(_ptr != p) + { + if(p) + { + incRef(p); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = p; + } + return *this; + } + + template<typename Y> + ProxyHandle& operator=(const ProxyHandle<Y>& r) + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + + template<typename Y> + ProxyHandle& operator=(const ::IceUtil::Handle<Y>& r) + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + ProxyHandle& operator=(const ProxyHandle<T>& r) +#else + ProxyHandle& operator=(const ProxyHandle& r) +#endif + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(_ptr) + { + decRef(_ptr); + } + + _ptr = r._ptr; + } + return *this; + } + + template<class Y> + static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f = "") + { + ProxyHandle p; + ::IceInternal::checkedCast(r, f, p); + return p; + } + + template<class Y> + static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r, const std::string& f = "") + { + ProxyHandle p; + ::IceInternal::uncheckedCast(r, f, p); + return p; + } +}; + +} + +#endif diff --git a/cpp/include/Ice/ReferenceF.h b/cpp/include/Ice/ReferenceF.h index 34c05bdbc01..a154aec6398 100644 --- a/cpp/include/Ice/ReferenceF.h +++ b/cpp/include/Ice/ReferenceF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_REFERENCE_F_H
-#define ICE_REFERENCE_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Reference;
-ICE_API void incRef(Reference*);
-ICE_API void decRef(Reference*);
-typedef IceInternal::Handle<Reference> ReferencePtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_REFERENCE_F_H +#define ICE_REFERENCE_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Reference; +ICE_API void incRef(Reference*); +ICE_API void decRef(Reference*); +typedef IceInternal::Handle<Reference> ReferencePtr; + +} + +#endif diff --git a/cpp/include/Ice/RoutingTable.h b/cpp/include/Ice/RoutingTable.h index 2d51a5ca97d..f0c56a672fb 100644 --- a/cpp/include/Ice/RoutingTable.h +++ b/cpp/include/Ice/RoutingTable.h @@ -1,53 +1,53 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ROUTING_TABLE_H
-#define ICE_ROUTING_TABLE_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/RoutingTableF.h>
-#include <Ice/ProxyF.h>
-
-namespace Ice
-{
-
-struct Identity;
-
-};
-
-namespace IceInternal
-{
-
-class ICE_API RoutingTable : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- RoutingTable();
-
- //
- // Returns false if the Proxy exists already.
- //
- bool add(const ::Ice::ObjectPrx&);
-
- //
- // Returns null if no Proxy exists for the given identity.
- //
- ::Ice::ObjectPrx get(const ::Ice::Identity&);
-
-private:
-
- std::map< ::Ice::Identity, ::Ice::ObjectPrx> _table;
- std::map< ::Ice::Identity, ::Ice::ObjectPrx>::iterator _tableHint;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ROUTING_TABLE_H +#define ICE_ROUTING_TABLE_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/RoutingTableF.h> +#include <Ice/ProxyF.h> + +namespace Ice +{ + +struct Identity; + +}; + +namespace IceInternal +{ + +class ICE_API RoutingTable : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + RoutingTable(); + + // + // Returns false if the Proxy exists already. + // + bool add(const ::Ice::ObjectPrx&); + + // + // Returns null if no Proxy exists for the given identity. + // + ::Ice::ObjectPrx get(const ::Ice::Identity&); + +private: + + std::map< ::Ice::Identity, ::Ice::ObjectPrx> _table; + std::map< ::Ice::Identity, ::Ice::ObjectPrx>::iterator _tableHint; +}; + +} + +#endif diff --git a/cpp/include/Ice/RoutingTableF.h b/cpp/include/Ice/RoutingTableF.h index 301769373d3..8c1a453c3c8 100644 --- a/cpp/include/Ice/RoutingTableF.h +++ b/cpp/include/Ice/RoutingTableF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ROUTING_TABLE_F_H
-#define ICE_ROUTING_TABLE_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class RoutingTable;
-ICE_API void incRef(RoutingTable*);
-ICE_API void decRef(RoutingTable*);
-typedef IceInternal::Handle<RoutingTable> RoutingTablePtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ROUTING_TABLE_F_H +#define ICE_ROUTING_TABLE_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class RoutingTable; +ICE_API void incRef(RoutingTable*); +ICE_API void decRef(RoutingTable*); +typedef IceInternal::Handle<RoutingTable> RoutingTablePtr; + +} + +#endif diff --git a/cpp/include/IcePatch/FileDescFactory.h b/cpp/include/IcePatch/FileDescFactory.h index dd4e0254a52..99b897c2684 100644 --- a/cpp/include/IcePatch/FileDescFactory.h +++ b/cpp/include/IcePatch/FileDescFactory.h @@ -1,30 +1,30 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PATCH_FILE_DESC_FACTORY_H
-#define ICE_PATCH_FILE_DESC_FACTORY_H
-
-#include <Ice/Ice.h>
-#include <IcePatch/IcePatch.h>
-
-namespace IcePatch
-{
-
-class ICE_PATCH_API FileDescFactory : public Ice::ObjectFactory
-{
-public:
-
- Ice::ObjectPtr create(const std::string&);
- void destroy();
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PATCH_FILE_DESC_FACTORY_H +#define ICE_PATCH_FILE_DESC_FACTORY_H + +#include <Ice/Ice.h> +#include <IcePatch/IcePatch.h> + +namespace IcePatch +{ + +class ICE_PATCH_API FileDescFactory : public Ice::ObjectFactory +{ +public: + + Ice::ObjectPtr create(const std::string&); + void destroy(); +}; + +} + +#endif diff --git a/cpp/include/IcePatch/Util.h b/cpp/include/IcePatch/Util.h index 4a5034bff4b..5b02b854761 100644 --- a/cpp/include/IcePatch/Util.h +++ b/cpp/include/IcePatch/Util.h @@ -1,72 +1,72 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PATCH_UTIL_H
-#define ICE_PATCH_UTIL_H
-
-#include <Ice/Ice.h>
-#include <IcePatch/IcePatch.h>
-
-namespace IcePatch
-{
-
-ICE_PATCH_API std::string identityToPath(const Ice::Identity&);
-ICE_PATCH_API Ice::Identity pathToIdentity(const std::string&);
-
-ICE_PATCH_API std::string getSuffix(const std::string&);
-ICE_PATCH_API bool ignoreSuffix(const std::string&);
-ICE_PATCH_API std::string removeSuffix(const std::string&);
-
-enum FileType
-{
- FileTypeNotExist,
- FileTypeDirectory,
- FileTypeRegular,
- FileTypeUnknown
-};
-
-struct FileInfo
-{
- FileType type;
- off_t size;
- time_t time;
-};
-
-ICE_PATCH_API FileInfo getFileInfo(const std::string&, bool);
-
-ICE_PATCH_API void removeRecursive(const std::string&);
-
-ICE_PATCH_API Ice::StringSeq readDirectory(const std::string&);
-ICE_PATCH_API void createDirectory(const std::string&);
-
-ICE_PATCH_API Ice::ByteSeq getMD5(const std::string&);
-ICE_PATCH_API Ice::ByteSeq getPartialMD5(const std::string&, Ice::Int);
-ICE_PATCH_API void createMD5(const std::string&);
-
-ICE_PATCH_API Ice::ByteSeq getBZ2(const std::string&, Ice::Int, Ice::Int);
-ICE_PATCH_API void createBZ2(const std::string&);
-
-class ICE_PATCH_API ProgressCB
-{
-public:
-
- virtual void startDownload(Ice::Int, Ice::Int) = 0;
- virtual void updateDownload(Ice::Int, Ice::Int) = 0;
- virtual void finishedDownload(Ice::Int) = 0;
-
- virtual void startUncompress(Ice::Int, Ice::Int) = 0;
- virtual void updateUncompress(Ice::Int, Ice::Int) = 0;
- virtual void finishedUncompress(Ice::Int) = 0;
-};
-ICE_PATCH_API void getRegular(const IcePatch::RegularPrx&, ProgressCB&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PATCH_UTIL_H +#define ICE_PATCH_UTIL_H + +#include <Ice/Ice.h> +#include <IcePatch/IcePatch.h> + +namespace IcePatch +{ + +ICE_PATCH_API std::string identityToPath(const Ice::Identity&); +ICE_PATCH_API Ice::Identity pathToIdentity(const std::string&); + +ICE_PATCH_API std::string getSuffix(const std::string&); +ICE_PATCH_API bool ignoreSuffix(const std::string&); +ICE_PATCH_API std::string removeSuffix(const std::string&); + +enum FileType +{ + FileTypeNotExist, + FileTypeDirectory, + FileTypeRegular, + FileTypeUnknown +}; + +struct FileInfo +{ + FileType type; + off_t size; + time_t time; +}; + +ICE_PATCH_API FileInfo getFileInfo(const std::string&, bool); + +ICE_PATCH_API void removeRecursive(const std::string&); + +ICE_PATCH_API Ice::StringSeq readDirectory(const std::string&); +ICE_PATCH_API void createDirectory(const std::string&); + +ICE_PATCH_API Ice::ByteSeq getMD5(const std::string&); +ICE_PATCH_API Ice::ByteSeq getPartialMD5(const std::string&, Ice::Int); +ICE_PATCH_API void createMD5(const std::string&); + +ICE_PATCH_API Ice::ByteSeq getBZ2(const std::string&, Ice::Int, Ice::Int); +ICE_PATCH_API void createBZ2(const std::string&); + +class ICE_PATCH_API ProgressCB +{ +public: + + virtual void startDownload(Ice::Int, Ice::Int) = 0; + virtual void updateDownload(Ice::Int, Ice::Int) = 0; + virtual void finishedDownload(Ice::Int) = 0; + + virtual void startUncompress(Ice::Int, Ice::Int) = 0; + virtual void updateUncompress(Ice::Int, Ice::Int) = 0; + virtual void finishedUncompress(Ice::Int) = 0; +}; +ICE_PATCH_API void getRegular(const IcePatch::RegularPrx&, ProgressCB&); + +} + +#endif diff --git a/cpp/include/IceSSL/CertificateVerifierOpenSSL.h b/cpp/include/IceSSL/CertificateVerifierOpenSSL.h index e06ca48f6ee..6b230612df6 100644 --- a/cpp/include/IceSSL/CertificateVerifierOpenSSL.h +++ b/cpp/include/IceSSL/CertificateVerifierOpenSSL.h @@ -1,57 +1,57 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CERTIFICATE_VERIFIER_OPENSSL_H
-#define ICE_SSL_CERTIFICATE_VERIFIER_OPENSSL_H
-
-#include <IceSSL/CertificateVerifier.h>
-#include <openssl/ssl.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ICE_SSL_API CertificateVerifier : public IceSSL::CertificateVerifier
-{
-public:
-
- virtual ~CertificateVerifier();
-
- virtual int verify(int, X509_STORE_CTX*, SSL*) = 0;
-};
-
-typedef IceInternal::Handle<IceSSL::OpenSSL::CertificateVerifier> CertificateVerifierPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-ICE_SSL_API void incRef(IceSSL::OpenSSL::CertificateVerifier*);
-ICE_SSL_API void decRef(IceSSL::OpenSSL::CertificateVerifier*);
-
-}
-
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CERTIFICATE_VERIFIER_OPENSSL_H +#define ICE_SSL_CERTIFICATE_VERIFIER_OPENSSL_H + +#include <IceSSL/CertificateVerifier.h> +#include <openssl/ssl.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ICE_SSL_API CertificateVerifier : public IceSSL::CertificateVerifier +{ +public: + + virtual ~CertificateVerifier(); + + virtual int verify(int, X509_STORE_CTX*, SSL*) = 0; +}; + +typedef IceInternal::Handle<IceSSL::OpenSSL::CertificateVerifier> CertificateVerifierPtr; + +} + +} + +namespace IceInternal +{ + +ICE_SSL_API void incRef(IceSSL::OpenSSL::CertificateVerifier*); +ICE_SSL_API void decRef(IceSSL::OpenSSL::CertificateVerifier*); + +} + + +#endif diff --git a/cpp/include/IceSSL/RSACertificateGen.h b/cpp/include/IceSSL/RSACertificateGen.h index 0288da8aeac..f6f8d74aeda 100644 --- a/cpp/include/IceSSL/RSACertificateGen.h +++ b/cpp/include/IceSSL/RSACertificateGen.h @@ -1,105 +1,105 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CERTIFICATE_GEN_H
-#define ICE_SSL_CERTIFICATE_GEN_H
-
-#include <IceSSL/RSAKeyPairF.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-using namespace std;
-
-class ICE_SSL_API RSACertificateGenContext
-{
-public:
-
- //
- // Static
- //
-
- // Conversion helper functions
- static long minutesToSeconds(long);
- static long hoursToSeconds(long);
- static long daysToSeconds(long);
- static long weeksToSeconds(long);
- static long yearsToSeconds(long);
-
- //
- // Instance
- //
-
- RSACertificateGenContext();
- ~RSACertificateGenContext();
-
- // Distinguished Name (setter) methods.
- void setCountry(const std::string&);
- void setStateProvince(const std::string&);
- void setLocality(const std::string&);
- void setOrganization(const std::string&);
- void setOrgainizationalUnit(const std::string&);
- void setCommonName(const std::string&);
-
- void setBitStrength(int);
- void setSecondsValid(long);
-
- // Distinguished Name (getters) methods.
- unsigned char* getCountry() const;
- unsigned char* getStateProvince() const;
- unsigned char* getLocality() const;
- unsigned char* getOrganization() const;
- unsigned char* getOrgainizationalUnit() const;
- unsigned char* getCommonName() const;
-
- int getModulusLength() const;
- long getSecondsValid() const;
-
-private:
-
- std::string _country;
- std::string _stateProvince;
- std::string _locality;
- std::string _organization;
- std::string _organizationalUnit;
- std::string _commonName;
- int _modulusLength;
- long _secondsValid;
-};
-
-class ICE_SSL_API RSACertificateGen
-{
-public:
-
- RSACertificateGen();
- ~RSACertificateGen();
-
- RSAKeyPairPtr generate(const RSACertificateGenContext&);
- RSAKeyPairPtr loadKeyPair(const std::string&, const std::string&);
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CERTIFICATE_GEN_H +#define ICE_SSL_CERTIFICATE_GEN_H + +#include <IceSSL/RSAKeyPairF.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +using namespace std; + +class ICE_SSL_API RSACertificateGenContext +{ +public: + + // + // Static + // + + // Conversion helper functions + static long minutesToSeconds(long); + static long hoursToSeconds(long); + static long daysToSeconds(long); + static long weeksToSeconds(long); + static long yearsToSeconds(long); + + // + // Instance + // + + RSACertificateGenContext(); + ~RSACertificateGenContext(); + + // Distinguished Name (setter) methods. + void setCountry(const std::string&); + void setStateProvince(const std::string&); + void setLocality(const std::string&); + void setOrganization(const std::string&); + void setOrgainizationalUnit(const std::string&); + void setCommonName(const std::string&); + + void setBitStrength(int); + void setSecondsValid(long); + + // Distinguished Name (getters) methods. + unsigned char* getCountry() const; + unsigned char* getStateProvince() const; + unsigned char* getLocality() const; + unsigned char* getOrganization() const; + unsigned char* getOrgainizationalUnit() const; + unsigned char* getCommonName() const; + + int getModulusLength() const; + long getSecondsValid() const; + +private: + + std::string _country; + std::string _stateProvince; + std::string _locality; + std::string _organization; + std::string _organizationalUnit; + std::string _commonName; + int _modulusLength; + long _secondsValid; +}; + +class ICE_SSL_API RSACertificateGen +{ +public: + + RSACertificateGen(); + ~RSACertificateGen(); + + RSAKeyPairPtr generate(const RSACertificateGenContext&); + RSAKeyPairPtr loadKeyPair(const std::string&, const std::string&); +}; + +} + +} + +#endif diff --git a/cpp/include/IceSSL/RSACertificateGenF.h b/cpp/include/IceSSL/RSACertificateGenF.h index 379d230e166..614310877b9 100644 --- a/cpp/include/IceSSL/RSACertificateGenF.h +++ b/cpp/include/IceSSL/RSACertificateGenF.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CERTIFICATE_GEN_F_H
-#define ICE_SSL_CERTIFICATE_GEN_F_H
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class RSACertificateGenContext;
-class RSACertificateGen;
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CERTIFICATE_GEN_F_H +#define ICE_SSL_CERTIFICATE_GEN_F_H + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class RSACertificateGenContext; +class RSACertificateGen; + +} + +} + +#endif diff --git a/cpp/include/IceSSL/RSAKeyPair.h b/cpp/include/IceSSL/RSAKeyPair.h index fc1518c33bf..907f0be5545 100644 --- a/cpp/include/IceSSL/RSAKeyPair.h +++ b/cpp/include/IceSSL/RSAKeyPair.h @@ -1,78 +1,78 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_KEY_PAIR_H
-#define ICE_SSL_RSA_KEY_PAIR_H
-
-#include <IceUtil/Shared.h>
-#include <openssl/ssl.h>
-
-#include <Ice/BuiltinSequences.h>
-
-#include <IceSSL/RSAKeyPairF.h>
-#include <IceSSL/RSACertificateGenF.h>
-#include <IceSSL/RSAPrivateKeyF.h>
-#include <IceSSL/RSAPublicKeyF.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ICE_SSL_API RSAKeyPair : public IceUtil::Shared
-{
-public:
-
- // Construction from Base64 encodings.
- RSAKeyPair(const std::string&, const std::string&);
-
- // Construction from binary DER encoding ByteSeq's.
- RSAKeyPair(const Ice::ByteSeq&, const Ice::ByteSeq&);
-
- ~RSAKeyPair();
-
- // Conversions to Base64 encodings.
- void keyToBase64(std::string&);
- void certToBase64(std::string&);
-
- // Conversions to binary DER encodings.
- void keyToByteSeq(Ice::ByteSeq&);
- void certToByteSeq(Ice::ByteSeq&);
-
- // Get the internal key structures as per the OpenSSL implementation.
- RSA* getRSAPrivateKey() const;
- X509* getX509PublicKey() const;
-
-private:
-
- RSAKeyPair(const RSAPrivateKeyPtr&, const RSAPublicKeyPtr&);
-
- friend class RSACertificateGen;
-
- RSAPrivateKeyPtr _privateKey;
- RSAPublicKeyPtr _publicKey;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_KEY_PAIR_H +#define ICE_SSL_RSA_KEY_PAIR_H + +#include <IceUtil/Shared.h> +#include <openssl/ssl.h> + +#include <Ice/BuiltinSequences.h> + +#include <IceSSL/RSAKeyPairF.h> +#include <IceSSL/RSACertificateGenF.h> +#include <IceSSL/RSAPrivateKeyF.h> +#include <IceSSL/RSAPublicKeyF.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ICE_SSL_API RSAKeyPair : public IceUtil::Shared +{ +public: + + // Construction from Base64 encodings. + RSAKeyPair(const std::string&, const std::string&); + + // Construction from binary DER encoding ByteSeq's. + RSAKeyPair(const Ice::ByteSeq&, const Ice::ByteSeq&); + + ~RSAKeyPair(); + + // Conversions to Base64 encodings. + void keyToBase64(std::string&); + void certToBase64(std::string&); + + // Conversions to binary DER encodings. + void keyToByteSeq(Ice::ByteSeq&); + void certToByteSeq(Ice::ByteSeq&); + + // Get the internal key structures as per the OpenSSL implementation. + RSA* getRSAPrivateKey() const; + X509* getX509PublicKey() const; + +private: + + RSAKeyPair(const RSAPrivateKeyPtr&, const RSAPublicKeyPtr&); + + friend class RSACertificateGen; + + RSAPrivateKeyPtr _privateKey; + RSAPublicKeyPtr _publicKey; +}; + +} + +} + +#endif diff --git a/cpp/include/IceSSL/RSAKeyPairF.h b/cpp/include/IceSSL/RSAKeyPairF.h index d0698ec55bb..a2c900326af 100644 --- a/cpp/include/IceSSL/RSAKeyPairF.h +++ b/cpp/include/IceSSL/RSAKeyPairF.h @@ -1,47 +1,47 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_KEY_PAIR_F_H
-#define ICE_SSL_RSA_KEY_PAIR_F_H
-
-#include <Ice/Handle.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class RSAKeyPair;
-typedef IceInternal::Handle<RSAKeyPair> RSAKeyPairPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void ICE_SSL_API incRef(::IceSSL::OpenSSL::RSAKeyPair*);
-void ICE_SSL_API decRef(::IceSSL::OpenSSL::RSAKeyPair*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_KEY_PAIR_F_H +#define ICE_SSL_RSA_KEY_PAIR_F_H + +#include <Ice/Handle.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class RSAKeyPair; +typedef IceInternal::Handle<RSAKeyPair> RSAKeyPairPtr; + +} + +} + +namespace IceInternal +{ + +void ICE_SSL_API incRef(::IceSSL::OpenSSL::RSAKeyPair*); +void ICE_SSL_API decRef(::IceSSL::OpenSSL::RSAKeyPair*); + +} + +#endif diff --git a/cpp/include/IceSSL/RSAPrivateKey.h b/cpp/include/IceSSL/RSAPrivateKey.h index cf72c1bbf26..49fc18ca1f3 100644 --- a/cpp/include/IceSSL/RSAPrivateKey.h +++ b/cpp/include/IceSSL/RSAPrivateKey.h @@ -1,73 +1,73 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_PRIVATE_KEY_H
-#define ICE_SSL_RSA_PRIVATE_KEY_H
-
-#include <IceUtil/Shared.h>
-
-#include <Ice/BuiltinSequences.h>
-
-#include <IceSSL/RSAPrivateKeyF.h>
-
-#include <openssl/ssl.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ICE_SSL_API RSAPrivateKey : public IceUtil::Shared
-{
-public:
-
- // Construction from Base64 encoding.
- RSAPrivateKey(const std::string&);
-
- // Construction from binary DER encoding ByteSeq.
- RSAPrivateKey(const Ice::ByteSeq&);
-
- // Construction from RSA Private Key structure (simple initialization).
- RSAPrivateKey(RSA*);
-
- ~RSAPrivateKey();
-
- // Conversion to Base64 encoding.
- void keyToBase64(std::string&);
-
- // Conversion to binary DER encoding.
- void keyToByteSeq(Ice::ByteSeq&);
-
- // Get the internal key structure as per the OpenSSL implementation.
- RSA* get() const;
-
-private:
-
- void byteSeqToKey(const Ice::ByteSeq&);
-
- RSA* _privateKey;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_PRIVATE_KEY_H +#define ICE_SSL_RSA_PRIVATE_KEY_H + +#include <IceUtil/Shared.h> + +#include <Ice/BuiltinSequences.h> + +#include <IceSSL/RSAPrivateKeyF.h> + +#include <openssl/ssl.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ICE_SSL_API RSAPrivateKey : public IceUtil::Shared +{ +public: + + // Construction from Base64 encoding. + RSAPrivateKey(const std::string&); + + // Construction from binary DER encoding ByteSeq. + RSAPrivateKey(const Ice::ByteSeq&); + + // Construction from RSA Private Key structure (simple initialization). + RSAPrivateKey(RSA*); + + ~RSAPrivateKey(); + + // Conversion to Base64 encoding. + void keyToBase64(std::string&); + + // Conversion to binary DER encoding. + void keyToByteSeq(Ice::ByteSeq&); + + // Get the internal key structure as per the OpenSSL implementation. + RSA* get() const; + +private: + + void byteSeqToKey(const Ice::ByteSeq&); + + RSA* _privateKey; +}; + +} + +} + +#endif diff --git a/cpp/include/IceSSL/RSAPrivateKeyF.h b/cpp/include/IceSSL/RSAPrivateKeyF.h index e8e301845d4..b907d439030 100644 --- a/cpp/include/IceSSL/RSAPrivateKeyF.h +++ b/cpp/include/IceSSL/RSAPrivateKeyF.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_PRIVATE_KEY_F_H
-#define ICE_SSL_RSA_PRIVATE_KEY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class RSAPrivateKey;
-typedef IceInternal::Handle<RSAPrivateKey> RSAPrivateKeyPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::OpenSSL::RSAPrivateKey*);
-void decRef(::IceSSL::OpenSSL::RSAPrivateKey*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_PRIVATE_KEY_F_H +#define ICE_SSL_RSA_PRIVATE_KEY_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class RSAPrivateKey; +typedef IceInternal::Handle<RSAPrivateKey> RSAPrivateKeyPtr; + +} + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::OpenSSL::RSAPrivateKey*); +void decRef(::IceSSL::OpenSSL::RSAPrivateKey*); + +} + +#endif diff --git a/cpp/include/IceSSL/RSAPublicKey.h b/cpp/include/IceSSL/RSAPublicKey.h index 372f36d5912..371bb17dbba 100644 --- a/cpp/include/IceSSL/RSAPublicKey.h +++ b/cpp/include/IceSSL/RSAPublicKey.h @@ -1,73 +1,73 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_PUBLIC_KEY_H
-#define ICE_SSL_RSA_PUBLIC_KEY_H
-
-#include <IceUtil/Shared.h>
-
-#include <Ice/BuiltinSequences.h>
-
-#include <IceSSL/RSAPublicKeyF.h>
-
-#include <openssl/ssl.h>
-
-#ifdef _WIN32
-# ifdef ICE_SSL_API_EXPORTS
-# define ICE_SSL_API __declspec(dllexport)
-# else
-# define ICE_SSL_API __declspec(dllimport)
-# endif
-#else
-# define ICE_SSL_API /**/
-#endif
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ICE_SSL_API RSAPublicKey : public IceUtil::Shared
-{
-public:
-
- // Construction from Base64 encoding.
- RSAPublicKey(const std::string&);
-
- // Construction from binary DER encoding ByteSeq.
- RSAPublicKey(const Ice::ByteSeq&);
-
- // Construction from X509 structure (simple initialization).
- RSAPublicKey(X509*);
-
- ~RSAPublicKey();
-
- // Conversion to Base64 encoding.
- void certToBase64(std::string&);
-
- // Conversion to binary DER encoding.
- void certToByteSeq(Ice::ByteSeq&);
-
- // Get the internal key structure as per the OpenSSL implementation.
- X509* getX509PublicKey() const;
-
-private:
-
- void byteSeqToCert(const Ice::ByteSeq&);
-
- X509* _publicKey;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_PUBLIC_KEY_H +#define ICE_SSL_RSA_PUBLIC_KEY_H + +#include <IceUtil/Shared.h> + +#include <Ice/BuiltinSequences.h> + +#include <IceSSL/RSAPublicKeyF.h> + +#include <openssl/ssl.h> + +#ifdef _WIN32 +# ifdef ICE_SSL_API_EXPORTS +# define ICE_SSL_API __declspec(dllexport) +# else +# define ICE_SSL_API __declspec(dllimport) +# endif +#else +# define ICE_SSL_API /**/ +#endif + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ICE_SSL_API RSAPublicKey : public IceUtil::Shared +{ +public: + + // Construction from Base64 encoding. + RSAPublicKey(const std::string&); + + // Construction from binary DER encoding ByteSeq. + RSAPublicKey(const Ice::ByteSeq&); + + // Construction from X509 structure (simple initialization). + RSAPublicKey(X509*); + + ~RSAPublicKey(); + + // Conversion to Base64 encoding. + void certToBase64(std::string&); + + // Conversion to binary DER encoding. + void certToByteSeq(Ice::ByteSeq&); + + // Get the internal key structure as per the OpenSSL implementation. + X509* getX509PublicKey() const; + +private: + + void byteSeqToCert(const Ice::ByteSeq&); + + X509* _publicKey; +}; + +} + +} + +#endif diff --git a/cpp/include/IceSSL/RSAPublicKeyF.h b/cpp/include/IceSSL/RSAPublicKeyF.h index 1cdc1103ced..b4ff5dd29b0 100644 --- a/cpp/include/IceSSL/RSAPublicKeyF.h +++ b/cpp/include/IceSSL/RSAPublicKeyF.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_RSA_PUBLIC_KEY_F_H
-#define ICE_SSL_RSA_PUBLIC_KEY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class RSAPublicKey;
-typedef IceInternal::Handle<RSAPublicKey> RSAPublicKeyPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::OpenSSL::RSAPublicKey*);
-void decRef(::IceSSL::OpenSSL::RSAPublicKey*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_RSA_PUBLIC_KEY_F_H +#define ICE_SSL_RSA_PUBLIC_KEY_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class RSAPublicKey; +typedef IceInternal::Handle<RSAPublicKey> RSAPublicKeyPtr; + +} + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::OpenSSL::RSAPublicKey*); +void decRef(::IceSSL::OpenSSL::RSAPublicKey*); + +} + +#endif diff --git a/cpp/include/IceUtil/Base64.h b/cpp/include/IceUtil/Base64.h index 74ce7f7bc0b..e9cee99b663 100644 --- a/cpp/include/IceUtil/Base64.h +++ b/cpp/include/IceUtil/Base64.h @@ -1,41 +1,41 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_BASE_64_H
-#define ICE_UTIL_BASE_64_H
-
-#include <IceUtil/Config.h>
-#include <string>
-#include <vector>
-
-namespace IceUtil
-{
-
-// Defined here to avoid using Ice::ByteSeq
-typedef std::vector<char> ICE_UTIL_API ByteSeq;
-
-class ICE_UTIL_API Base64
-{
-public:
-
- static std::string encode(const ByteSeq&);
- static ByteSeq decode(const std::string&);
-
-
-private:
-
- static char encode(unsigned char);
- static unsigned char decode(char);
- static bool isBase64(char);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_BASE_64_H +#define ICE_UTIL_BASE_64_H + +#include <IceUtil/Config.h> +#include <string> +#include <vector> + +namespace IceUtil +{ + +// Defined here to avoid using Ice::ByteSeq +typedef std::vector<char> ICE_UTIL_API ByteSeq; + +class ICE_UTIL_API Base64 +{ +public: + + static std::string encode(const ByteSeq&); + static ByteSeq decode(const std::string&); + + +private: + + static char encode(unsigned char); + static unsigned char decode(char); + static bool isBase64(char); +}; + +} + +#endif diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h index 2059bff9a00..c57c18a27ec 100644 --- a/cpp/include/IceUtil/Cond.h +++ b/cpp/include/IceUtil/Cond.h @@ -1,334 +1,334 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_COND_H
-#define ICE_UTIL_COND_H
-
-#include <IceUtil/Config.h>
-#include <IceUtil/Exception.h>
-#include <IceUtil/Time.h>
-
-#ifdef _WIN32
-//
-// Needed for implementation under WIN32.
-//
-# include <IceUtil/Mutex.h>
-//
-// See member-template note for waitImpl & timedWaitImpl.
-//
-# include <IceUtil/RecMutex.h>
-#endif
-
-namespace IceUtil
-{
-
-//
-// Forward declaration (for friend declarations).
-//
-template <class T> class Monitor;
-class RecMutex;
-class Mutex;
-
-#ifdef _WIN32
-//
-// Needed for implementation.
-//
-class Semaphore
-{
-public:
-
- Semaphore(long = 0);
- ~Semaphore();
-
- void wait() const;
- bool timedWait(const Time&) const;
- void post(int = 1) const;
-
-private:
-
- mutable HANDLE _sem;
-};
-#endif
-
-//
-// Condition variable implementation. Conforms to the same semantics
-// as a POSIX threads condition variable.
-//
-class ICE_UTIL_API Cond : public noncopyable
-{
-public:
-
- Cond();
- ~Cond();
-
- //
- // signal restarts one of the threads that are waiting on the
- // condition variable cond. If no threads are waiting on cond,
- // nothing happens. If several threads are waiting on cond,
- // exactly one is restarted, but it is not specified which.
- //
- void signal();
-
- //
- // broadcast restarts all the threads that are waiting on the
- // condition variable cond. Nothing happens if no threads are
- // waiting on cond.
- //
- void broadcast();
-
- //
- // MSVC doesn't support out-of-class definitions of member
- // templates. See KB Article Q241949 for details.
- //
-
- //
- // wait atomically unlocks the mutex and waits for the condition
- // variable to be signaled. Before returning to the calling thread
- // the mutex is reaquired.
- //
- template <typename Lock> inline void
- wait(const Lock& lock) const
- {
- waitImpl(lock._mutex);
- }
-
- //
- // wait atomically unlocks the mutex and waits for the condition
- // variable to be signaled for up to the given timeout. Before
- // returning to the calling thread the mutex is reaquired. Returns
- // true if the condition variable was signaled, false on a
- // timeout.
- //
- template <typename Lock> inline bool
- timedWait(const Lock& lock, const Time& timeout) const
- {
- return timedWaitImpl(lock._mutex, timeout);
- }
-
-private:
-
- friend class Monitor<Mutex>;
- friend class Monitor<RecMutex>;
-
- //
- // The Monitor implementation uses waitImpl & timedWaitImpl.
- //
-#ifdef _WIN32
-
- //
- // For some reason under WIN32 with VC6 using a member-template
- // for waitImpl & timedWaitImpl results in a link error for
- // RecMutex.
- //
-/*
- template <typename M> void
- waitImpl(const M& mutex) const
- {
- preWait();
-
- typedef typename M::LockState LockState;
-
- LockState state;
- mutex.unlock(state);
-
- try
- {
- dowait(-1);
- mutex.lock(state);
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
- template <typename M> bool
- timedWaitImpl(const M& mutex, const Time& timeout) const
- {
- preWait();
-
- typedef typename M::LockState LockState;
-
- LockState state;
- mutex.unlock(state);
-
- try
- {
- bool rc = dowait(timeout);
- mutex.lock(state);
- return rc;
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
- */
-
- void
- waitImpl(const RecMutex& mutex) const
- {
- preWait();
-
- RecMutex::LockState state;
- mutex.unlock(state);
-
- try
- {
- dowait();
- mutex.lock(state);
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
-
- void
- waitImpl(const Mutex& mutex) const
- {
- preWait();
-
- Mutex::LockState state;
- mutex.unlock(state);
-
- try
- {
- dowait();
- mutex.lock(state);
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
-
- bool
- timedWaitImpl(const RecMutex& mutex, const Time& timeout) const
- {
- preWait();
-
- RecMutex::LockState state;
- mutex.unlock(state);
-
- try
- {
- bool rc = timedDowait(timeout);
- mutex.lock(state);
- return rc;
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
-
- bool
- timedWaitImpl(const Mutex& mutex, const Time& timeout) const
- {
- preWait();
-
- Mutex::LockState state;
- mutex.unlock(state);
-
- try
- {
- bool rc = timedDowait(timeout);
- mutex.lock(state);
- return rc;
- }
- catch(...)
- {
- mutex.lock(state);
- throw;
- }
- }
-
-#else
-
- template <typename M> void waitImpl(const M&) const;
- template <typename M> bool timedWaitImpl(const M&, const Time&) const;
-
-#endif
-
-#ifdef _WIN32
- void wake(bool);
- void preWait() const;
- void postWait(bool) const;
- bool timedDowait(const Time&) const;
- void dowait() const;
-
- Mutex _internal;
- Semaphore _gate;
- Semaphore _queue;
- mutable long _blocked;
- mutable long _unblocked;
- mutable long _toUnblock;
-#else
- mutable pthread_cond_t _cond;
-#endif
-
-};
-
-#ifndef _WIN32
-template <typename M> inline void
-Cond::waitImpl(const M& mutex) const
-{
- typedef typename M::LockState LockState;
-
- LockState state;
- mutex.unlock(state);
- int rc = pthread_cond_wait(&_cond, state.mutex);
- mutex.lock(state);
-
- if(rc != 0)
- {
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
-}
-
-template <typename M> inline bool
-Cond::timedWaitImpl(const M& mutex, const Time& timeout) const
-{
- typedef typename M::LockState LockState;
-
- LockState state;
- mutex.unlock(state);
-
- timeval tv = Time::now() + timeout;
- timespec ts;
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec*1000;
- int rc = pthread_cond_timedwait(&_cond, state.mutex, &ts);
- mutex.lock(state);
-
- if(rc != 0)
- {
- //
- // pthread_cond_timedwait returns ETIMEOUT in the event of a
- // timeout.
- //
- if(rc != ETIMEDOUT)
- {
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
- return false;
- }
- return true;
-}
-#endif
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_COND_H +#define ICE_UTIL_COND_H + +#include <IceUtil/Config.h> +#include <IceUtil/Exception.h> +#include <IceUtil/Time.h> + +#ifdef _WIN32 +// +// Needed for implementation under WIN32. +// +# include <IceUtil/Mutex.h> +// +// See member-template note for waitImpl & timedWaitImpl. +// +# include <IceUtil/RecMutex.h> +#endif + +namespace IceUtil +{ + +// +// Forward declaration (for friend declarations). +// +template <class T> class Monitor; +class RecMutex; +class Mutex; + +#ifdef _WIN32 +// +// Needed for implementation. +// +class Semaphore +{ +public: + + Semaphore(long = 0); + ~Semaphore(); + + void wait() const; + bool timedWait(const Time&) const; + void post(int = 1) const; + +private: + + mutable HANDLE _sem; +}; +#endif + +// +// Condition variable implementation. Conforms to the same semantics +// as a POSIX threads condition variable. +// +class ICE_UTIL_API Cond : public noncopyable +{ +public: + + Cond(); + ~Cond(); + + // + // signal restarts one of the threads that are waiting on the + // condition variable cond. If no threads are waiting on cond, + // nothing happens. If several threads are waiting on cond, + // exactly one is restarted, but it is not specified which. + // + void signal(); + + // + // broadcast restarts all the threads that are waiting on the + // condition variable cond. Nothing happens if no threads are + // waiting on cond. + // + void broadcast(); + + // + // MSVC doesn't support out-of-class definitions of member + // templates. See KB Article Q241949 for details. + // + + // + // wait atomically unlocks the mutex and waits for the condition + // variable to be signaled. Before returning to the calling thread + // the mutex is reaquired. + // + template <typename Lock> inline void + wait(const Lock& lock) const + { + waitImpl(lock._mutex); + } + + // + // wait atomically unlocks the mutex and waits for the condition + // variable to be signaled for up to the given timeout. Before + // returning to the calling thread the mutex is reaquired. Returns + // true if the condition variable was signaled, false on a + // timeout. + // + template <typename Lock> inline bool + timedWait(const Lock& lock, const Time& timeout) const + { + return timedWaitImpl(lock._mutex, timeout); + } + +private: + + friend class Monitor<Mutex>; + friend class Monitor<RecMutex>; + + // + // The Monitor implementation uses waitImpl & timedWaitImpl. + // +#ifdef _WIN32 + + // + // For some reason under WIN32 with VC6 using a member-template + // for waitImpl & timedWaitImpl results in a link error for + // RecMutex. + // +/* + template <typename M> void + waitImpl(const M& mutex) const + { + preWait(); + + typedef typename M::LockState LockState; + + LockState state; + mutex.unlock(state); + + try + { + dowait(-1); + mutex.lock(state); + } + catch(...) + { + mutex.lock(state); + throw; + } + } + template <typename M> bool + timedWaitImpl(const M& mutex, const Time& timeout) const + { + preWait(); + + typedef typename M::LockState LockState; + + LockState state; + mutex.unlock(state); + + try + { + bool rc = dowait(timeout); + mutex.lock(state); + return rc; + } + catch(...) + { + mutex.lock(state); + throw; + } + } + */ + + void + waitImpl(const RecMutex& mutex) const + { + preWait(); + + RecMutex::LockState state; + mutex.unlock(state); + + try + { + dowait(); + mutex.lock(state); + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + void + waitImpl(const Mutex& mutex) const + { + preWait(); + + Mutex::LockState state; + mutex.unlock(state); + + try + { + dowait(); + mutex.lock(state); + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + bool + timedWaitImpl(const RecMutex& mutex, const Time& timeout) const + { + preWait(); + + RecMutex::LockState state; + mutex.unlock(state); + + try + { + bool rc = timedDowait(timeout); + mutex.lock(state); + return rc; + } + catch(...) + { + mutex.lock(state); + throw; + } + } + + bool + timedWaitImpl(const Mutex& mutex, const Time& timeout) const + { + preWait(); + + Mutex::LockState state; + mutex.unlock(state); + + try + { + bool rc = timedDowait(timeout); + mutex.lock(state); + return rc; + } + catch(...) + { + mutex.lock(state); + throw; + } + } + +#else + + template <typename M> void waitImpl(const M&) const; + template <typename M> bool timedWaitImpl(const M&, const Time&) const; + +#endif + +#ifdef _WIN32 + void wake(bool); + void preWait() const; + void postWait(bool) const; + bool timedDowait(const Time&) const; + void dowait() const; + + Mutex _internal; + Semaphore _gate; + Semaphore _queue; + mutable long _blocked; + mutable long _unblocked; + mutable long _toUnblock; +#else + mutable pthread_cond_t _cond; +#endif + +}; + +#ifndef _WIN32 +template <typename M> inline void +Cond::waitImpl(const M& mutex) const +{ + typedef typename M::LockState LockState; + + LockState state; + mutex.unlock(state); + int rc = pthread_cond_wait(&_cond, state.mutex); + mutex.lock(state); + + if(rc != 0) + { + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } +} + +template <typename M> inline bool +Cond::timedWaitImpl(const M& mutex, const Time& timeout) const +{ + typedef typename M::LockState LockState; + + LockState state; + mutex.unlock(state); + + timeval tv = Time::now() + timeout; + timespec ts; + ts.tv_sec = tv.tv_sec; + ts.tv_nsec = tv.tv_usec*1000; + int rc = pthread_cond_timedwait(&_cond, state.mutex, &ts); + mutex.lock(state); + + if(rc != 0) + { + // + // pthread_cond_timedwait returns ETIMEOUT in the event of a + // timeout. + // + if(rc != ETIMEDOUT) + { + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } + return false; + } + return true; +} +#endif + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 5823038aaeb..1250469e08a 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -1,131 +1,131 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_CONFIG_H
-#define ICE_UTIL_CONFIG_H
-
-//
-// For STLport. If we compile in debug mode, we want to use the debug
-// STLport library. This is done by setting _STLP_DEBUG before any
-// STLport header files are included.
-//
-# if !defined(NDEBUG) && !defined(_STLP_DEBUG)
-# define _STLP_DEBUG
-# endif
-
-//
-// For STLport. If we compile in debug mode, we want to use the debug
-// memory allocation, so that purify doesn't report bogus memory
-// leaks. This is done by setting _STLP_USE_MALLOC before any STLport
-// header files are included.
-//
-# if !defined(NDEBUG) && !defined(_STLP_USE_MALLOC)
-# define _STLP_USE_MALLOC
-# endif
-
-#if defined(_WIN32)
-
-// Necessary for TryEnterCriticalSection.
-# define _WIN32_WINNT 0x0400
-
-# if !defined(_UNICODE)
-# error "Only unicode libraries can be used with Ice!"
-# endif
-
-# if !defined(_DLL) || !defined(_MT)
-# error "Only multi-threaded DLL libraries can be used with Ice!"
-# endif
-
-# ifdef ICE_UTIL_API_EXPORTS
-# define ICE_UTIL_API __declspec(dllexport)
-# else
-# define ICE_UTIL_API __declspec(dllimport)
-# endif
-
-# include <windows.h>
-
-// '...' : forcing value to bool 'true' or 'false' (performance warning)
-# pragma warning( disable : 4800 )
-// ... identifier was truncated to '255' characters in the debug information
-# pragma warning( disable : 4786 )
-// 'this' : used in base member initializer list
-# pragma warning( disable : 4355 )
-// class ... needs to have dll-interface to be used by clients of class ...
-# pragma warning( disable : 4251 )
-// ... : inherits ... via dominance
-# pragma warning( disable : 4250 )
-// non dll-interface class ... used as base for dll-interface class ...
-# pragma warning( disable : 4275 )
-// ...: decorated name length exceeded, name was truncated
-# pragma warning( disable : 4503 )
-
-# define SIZEOF_WCHAR_T 2
-
-#elif defined(__linux__) && defined(i386)
-
-# define ICE_UTIL_API /**/
-# define HAVE_READLINE
-# define SIZEOF_WCHAR_T 4
-
-#else
-
-# error "unsupported operating system or platform"
-
-#endif
-
-//
-// Some include files we need almost everywhere
-//
-#include <cassert>
-#include <iostream>
-#include <sstream>
-
-#ifndef _WIN32
-# ifndef _REENTRANT
-# define _REENTRANT 1
-# endif
-# include <pthread.h>
-# include <errno.h>
-#endif
-
-//
-// By deriving from this class, other classes are made non-copyable
-//
-namespace IceUtil
-{
-
-//
-// TODO: Constructor and destructor should not be inlined, as they are
-// not performance critical.
-//
-// TODO: Naming conventions?
-//
-class noncopyable
-{
-protected:
-
- noncopyable() { }
- ~noncopyable() { } // May not be virtual! Classes without virtual operations also derive from noncopyable.
-
-private:
-
- noncopyable(const noncopyable&);
- const noncopyable& operator=(const noncopyable&);
-};
-
-}
-
-//
-// The Ice version
-//
-#define ICE_STRING_VERSION "0.0.1"
-#define ICE_INT_VERSION 0x00000001
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_CONFIG_H +#define ICE_UTIL_CONFIG_H + +// +// For STLport. If we compile in debug mode, we want to use the debug +// STLport library. This is done by setting _STLP_DEBUG before any +// STLport header files are included. +// +# if !defined(NDEBUG) && !defined(_STLP_DEBUG) +# define _STLP_DEBUG +# endif + +// +// For STLport. If we compile in debug mode, we want to use the debug +// memory allocation, so that purify doesn't report bogus memory +// leaks. This is done by setting _STLP_USE_MALLOC before any STLport +// header files are included. +// +# if !defined(NDEBUG) && !defined(_STLP_USE_MALLOC) +# define _STLP_USE_MALLOC +# endif + +#if defined(_WIN32) + +// Necessary for TryEnterCriticalSection. +# define _WIN32_WINNT 0x0400 + +# if !defined(_UNICODE) +# error "Only unicode libraries can be used with Ice!" +# endif + +# if !defined(_DLL) || !defined(_MT) +# error "Only multi-threaded DLL libraries can be used with Ice!" +# endif + +# ifdef ICE_UTIL_API_EXPORTS +# define ICE_UTIL_API __declspec(dllexport) +# else +# define ICE_UTIL_API __declspec(dllimport) +# endif + +# include <windows.h> + +// '...' : forcing value to bool 'true' or 'false' (performance warning) +# pragma warning( disable : 4800 ) +// ... identifier was truncated to '255' characters in the debug information +# pragma warning( disable : 4786 ) +// 'this' : used in base member initializer list +# pragma warning( disable : 4355 ) +// class ... needs to have dll-interface to be used by clients of class ... +# pragma warning( disable : 4251 ) +// ... : inherits ... via dominance +# pragma warning( disable : 4250 ) +// non dll-interface class ... used as base for dll-interface class ... +# pragma warning( disable : 4275 ) +// ...: decorated name length exceeded, name was truncated +# pragma warning( disable : 4503 ) + +# define SIZEOF_WCHAR_T 2 + +#elif defined(__linux__) && defined(i386) + +# define ICE_UTIL_API /**/ +# define HAVE_READLINE +# define SIZEOF_WCHAR_T 4 + +#else + +# error "unsupported operating system or platform" + +#endif + +// +// Some include files we need almost everywhere +// +#include <cassert> +#include <iostream> +#include <sstream> + +#ifndef _WIN32 +# ifndef _REENTRANT +# define _REENTRANT 1 +# endif +# include <pthread.h> +# include <errno.h> +#endif + +// +// By deriving from this class, other classes are made non-copyable +// +namespace IceUtil +{ + +// +// TODO: Constructor and destructor should not be inlined, as they are +// not performance critical. +// +// TODO: Naming conventions? +// +class noncopyable +{ +protected: + + noncopyable() { } + ~noncopyable() { } // May not be virtual! Classes without virtual operations also derive from noncopyable. + +private: + + noncopyable(const noncopyable&); + const noncopyable& operator=(const noncopyable&); +}; + +} + +// +// The Ice version +// +#define ICE_STRING_VERSION "0.0.1" +#define ICE_INT_VERSION 0x00000001 + +#endif diff --git a/cpp/include/IceUtil/Exception.h b/cpp/include/IceUtil/Exception.h index 5d45362db38..2993d866a9b 100644 --- a/cpp/include/IceUtil/Exception.h +++ b/cpp/include/IceUtil/Exception.h @@ -1,85 +1,85 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_EXCEPTION_H
-#define ICE_UTIL_EXCEPTION_H
-
-#include <IceUtil/Config.h>
-
-namespace IceUtil
-{
-
-class ICE_UTIL_API Exception
-{
-public:
-
- Exception();
- Exception(const char*, int);
- virtual ~Exception();
- virtual std::string ice_name() const;
- virtual void ice_print(std::ostream&) const;
- virtual Exception* ice_clone() const;
- virtual void ice_throw() const;
- const char* ice_file() const;
- int ice_line() const;
-
-private:
-
- const char* _file;
- int _line;
-};
-
-ICE_UTIL_API std::ostream& operator<<(std::ostream&, const Exception&);
-
-class ICE_UTIL_API NullHandleException : public Exception
-{
-public:
-
- NullHandleException(const char*, int);
- virtual std::string ice_name() const;
- virtual Exception* ice_clone() const;
- virtual void ice_throw() const;
-};
-
-class ICE_UTIL_API SyscallException : public Exception
-{
-public:
-
- SyscallException(const std::string&, const char*, int);
- virtual std::string ice_name() const;
- virtual void ice_print(std::ostream&) const;
- virtual Exception* ice_clone() const;
- virtual void ice_throw() const;
-
-#ifdef _WIN32
- //
- // IceInternal::errorToString does the same thing... refactor?
- //
- static std::string errorToString(DWORD);
-#endif
-
-private:
-
- std::string _error;
-};
-
-class ICE_UTIL_API LockedException : public Exception
-{
-public:
-
- LockedException(const char*, int);
- virtual std::string ice_name() const;
- virtual Exception* ice_clone() const;
- virtual void ice_throw() const;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_EXCEPTION_H +#define ICE_UTIL_EXCEPTION_H + +#include <IceUtil/Config.h> + +namespace IceUtil +{ + +class ICE_UTIL_API Exception +{ +public: + + Exception(); + Exception(const char*, int); + virtual ~Exception(); + virtual std::string ice_name() const; + virtual void ice_print(std::ostream&) const; + virtual Exception* ice_clone() const; + virtual void ice_throw() const; + const char* ice_file() const; + int ice_line() const; + +private: + + const char* _file; + int _line; +}; + +ICE_UTIL_API std::ostream& operator<<(std::ostream&, const Exception&); + +class ICE_UTIL_API NullHandleException : public Exception +{ +public: + + NullHandleException(const char*, int); + virtual std::string ice_name() const; + virtual Exception* ice_clone() const; + virtual void ice_throw() const; +}; + +class ICE_UTIL_API SyscallException : public Exception +{ +public: + + SyscallException(const std::string&, const char*, int); + virtual std::string ice_name() const; + virtual void ice_print(std::ostream&) const; + virtual Exception* ice_clone() const; + virtual void ice_throw() const; + +#ifdef _WIN32 + // + // IceInternal::errorToString does the same thing... refactor? + // + static std::string errorToString(DWORD); +#endif + +private: + + std::string _error; +}; + +class ICE_UTIL_API LockedException : public Exception +{ +public: + + LockedException(const char*, int); + virtual std::string ice_name() const; + virtual Exception* ice_clone() const; + virtual void ice_throw() const; +}; + +} + +#endif diff --git a/cpp/include/IceUtil/Functional.h b/cpp/include/IceUtil/Functional.h index 9936bcce85d..3552c9d10c6 100644 --- a/cpp/include/IceUtil/Functional.h +++ b/cpp/include/IceUtil/Functional.h @@ -1,453 +1,453 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_FUNCTIONAL_H
-#define ICE_UTIL_FUNCTIONAL_H
-
-#include <IceUtil/Handle.h>
-#include <functional>
-
-namespace IceUtilInternal
-{
-
-// ----------------------------------------------------------------------
-// Various function objects that work with handles instead of plain
-// pointers.
-// ----------------------------------------------------------------------
-
-template<class R, class T, class H>
-class MemFun : public std::unary_function<H, R>
-{
- typedef R (T::*MemberFN)(void);
- MemberFN _mfn;
-
-public:
-
- explicit MemFun(MemberFN p) : _mfn(p) { }
- R operator()(H handle) const
- {
- return (handle.get() ->* _mfn)();
- }
-};
-
-template<class R, class T, class H, class A>
-class MemFun1 : public std::binary_function<H, A, R>
-{
- typedef R (T::*MemberFN)(A);
- MemberFN _mfn;
-
-public:
-
- explicit MemFun1(MemberFN p) : _mfn(p) { }
- R operator()(H handle, A arg) const
- {
- return (handle.get() ->* _mfn)(arg);
- }
-};
-
-template<class T, class H>
-class VoidMemFun : public std::unary_function<H, void>
-{
- typedef void (T::*MemberFN)(void);
- MemberFN _mfn;
-
-public:
-
- explicit VoidMemFun(MemberFN p) : _mfn(p) { }
- void operator()(H handle) const
- {
- (handle.get() ->* _mfn)();
- }
-};
-
-template<class T, class H, class A>
-class VoidMemFun1 : public std::binary_function<H, A, void>
-{
- typedef void (T::*MemberFN)(A);
- MemberFN _mfn;
-
-public:
-
- explicit VoidMemFun1(MemberFN p) : _mfn(p) { }
- void operator()(H handle, A arg) const
- {
- (handle.get() ->* _mfn)(arg);
- }
-};
-
-template<class R, class K, class T, class H>
-class SecondMemFun : public std::unary_function<std::pair<K, H>, R>
-{
- typedef R (T::*MemberFN)(void);
- MemberFN _mfn;
-
-public:
-
- explicit SecondMemFun(MemberFN p) : _mfn(p) { }
- R operator()(std::pair<K, H> pair) const
- {
- return (pair.second.get() ->* _mfn)();
- }
-};
-
-template<class R, class K, class T, class H, class A>
-class SecondMemFun1 : public std::binary_function<std::pair<K, H>, A, R>
-{
- typedef R (T::*MemberFN)(A);
- MemberFN _mfn;
-
-public:
-
- explicit SecondMemFun1(MemberFN p) : _mfn(p) { }
- R operator()(std::pair<K, H> pair, A arg) const
- {
- return (pair.second.get() ->* _mfn)(arg);
- }
-};
-
-template<class K, class T, class H>
-class SecondVoidMemFun : public std::unary_function<std::pair<K, H>, void>
-{
- typedef void (T::*MemberFN)(void);
- MemberFN _mfn;
-
-public:
-
- explicit SecondVoidMemFun(MemberFN p) : _mfn(p) { }
- void operator()(std::pair<K, H> pair) const
- {
- (pair.second.get() ->* _mfn)();
- }
-};
-
-template<class K, class T, class H, class A>
-class SecondVoidMemFun1 : public std::binary_function<std::pair<K, H>, A, void>
-{
- typedef void (T::*MemberFN)(A);
- MemberFN _mfn;
-
-public:
-
- explicit SecondVoidMemFun1(MemberFN p) : _mfn(p) { }
- void operator()(std::pair<K, H> pair, A arg) const
- {
- (pair.second.get() ->* _mfn)(arg);
- }
-};
-
-template<class R, class T, class H>
-class ConstMemFun : public std::unary_function<H, R>
-{
- typedef R (T::*MemberFN)(void) const;
- MemberFN _mfn;
-
-public:
-
- explicit ConstMemFun(MemberFN p) : _mfn(p) { }
- R operator()(H handle) const
- {
- return (handle.get() ->* _mfn)();
- }
-};
-
-template<class R, class T, class H, class A>
-class ConstMemFun1 : public std::binary_function<H, A, R>
-{
- typedef R (T::*MemberFN)(A) const;
- MemberFN _mfn;
-
-public:
-
- explicit ConstMemFun1(MemberFN p) : _mfn(p) { }
- R operator()(H handle, A arg) const
- {
- return (handle.get() ->* _mfn)(arg);
- }
-};
-
-template<class T, class H>
-class ConstVoidMemFun : public std::unary_function<H, void>
-{
- typedef void (T::*MemberFN)(void) const;
- MemberFN _mfn;
-
-public:
-
- explicit ConstVoidMemFun(MemberFN p) : _mfn(p) { }
- void operator()(H handle) const
- {
- (handle.get() ->* _mfn)();
- }
-};
-
-template<class T, class H, class A>
-class ConstVoidMemFun1 : public std::binary_function<H, A, void>
-{
- typedef void (T::*MemberFN)(A) const;
- MemberFN _mfn;
-
-public:
-
- explicit ConstVoidMemFun1(MemberFN p) : _mfn(p) { }
- void operator()(H handle, A arg) const
- {
- (handle.get() ->* _mfn)(arg);
- }
-};
-
-template<class R, class K, class T, class H>
-class SecondConstMemFun : public std::unary_function<std::pair<K, H>, R>
-{
- typedef R (T::*MemberFN)(void) const;
- MemberFN _mfn;
-
-public:
-
- explicit SecondConstMemFun(MemberFN p) : _mfn(p) { }
- R operator()(std::pair<K, H> pair) const
- {
- return (pair.second.get() ->* _mfn)();
- }
-};
-
-template<class R, class K, class T, class H, class A>
-class SecondConstMemFun1 : public std::binary_function<std::pair<K, H>, A, R>
-{
- typedef R (T::*MemberFN)(A) const;
- MemberFN _mfn;
-
-public:
-
- explicit SecondConstMemFun1(MemberFN p) : _mfn(p) { }
- R operator()(std::pair<K, H> pair, A arg) const
- {
- return (pair.second.get() ->* _mfn)(arg);
- }
-};
-
-template<class K, class T, class H>
-class SecondConstVoidMemFun : public std::unary_function<std::pair<K, H>, void>
-{
- typedef void (T::*MemberFN)(void) const;
- MemberFN _mfn;
-
-public:
-
- explicit SecondConstVoidMemFun(MemberFN p) : _mfn(p) { }
- void operator()(std::pair<K, H> pair) const
- {
- (pair.second.get() ->* _mfn)();
- }
-};
-
-template<class K, class T, class H, class A>
-class SecondConstVoidMemFun1 : public std::binary_function<std::pair<K, H>, A, void>
-{
- typedef void (T::*MemberFN)(A) const;
- MemberFN _mfn;
-
-public:
-
- explicit SecondConstVoidMemFun1(MemberFN p) : _mfn(p) { }
- void operator()(std::pair<K, H> pair, A arg) const
- {
- (pair.second.get() ->* _mfn)(arg);
- }
-};
-
-}
-
-// ----------------------------------------------------------------------
-// Inline functions that return function objects that work with
-// IceUtil::Handle
-// ----------------------------------------------------------------------
-
-namespace IceUtil
-{
-
-template<class R, class T>
-inline ::IceUtilInternal::MemFun<R, T, Handle<T> >
-memFun(R (T::*p)(void))
-{
- return ::IceUtilInternal::MemFun<R, T, Handle<T> >(p);
-}
-
-template<class R, class T, class A>
-inline ::IceUtilInternal::MemFun1<R, T, Handle<T>, A>
-memFun1(R (T::*p)(A))
-{
- return ::IceUtilInternal::MemFun1<R, T, Handle<T>, A>(p);
-}
-
-template<class T>
-inline ::IceUtilInternal::VoidMemFun<T, Handle<T> >
-voidMemFun(void (T::*p)(void))
-{
- return ::IceUtilInternal::VoidMemFun<T, Handle<T> >(p);
-}
-
-template<class T, class A>
-inline ::IceUtilInternal::VoidMemFun1<T, Handle<T>, A>
-voidMemFun1(void (T::*p)(A))
-{
- return ::IceUtilInternal::VoidMemFun1<T, Handle<T>, A>(p);
-}
-
-template<class R, class K, class T>
-inline ::IceUtilInternal::SecondMemFun<R, K, T, Handle<T> >
-secondMemFun(R (T::*p)(void))
-{
- return ::IceUtilInternal::SecondMemFun<R, K, T, Handle<T> >(p);
-}
-
-template<class R, class K, class T, class A>
-inline ::IceUtilInternal::SecondMemFun1<R, K, T, Handle<T>, A>
-secondMemFun1(R (T::*p)(A))
-{
- return ::IceUtilInternal::SecondMemFun1<R, K, T, Handle<T>, A>(p);
-}
-
-template<class K, class T>
-inline ::IceUtilInternal::SecondVoidMemFun<K, T, Handle<T> >
-secondVoidMemFun(void (T::*p)(void))
-{
- return ::IceUtilInternal::SecondVoidMemFun<K, T, Handle<T> >(p);
-}
-
-template<class K, class T, class A>
-inline ::IceUtilInternal::SecondVoidMemFun1<K, T, Handle<T>, A>
-secondVoidMemFun1(void (T::*p)(A))
-{
- return ::IceUtilInternal::SecondVoidMemFun1<K, T, Handle<T>, A>(p);
-}
-
-template<class R, class T>
-inline ::IceUtilInternal::ConstMemFun<R, T, Handle<T> >
-constMemFun(R (T::*p)(void) const)
-{
- return ::IceUtilInternal::ConstMemFun<R, T, Handle<T> >(p);
-}
-
-template<class R, class T, class A>
-inline ::IceUtilInternal::ConstMemFun1<R, T, Handle<T>, A>
-constMemFun1(R (T::*p)(A) const)
-{
- return ::IceUtilInternal::ConstMemFun1<R, T, Handle<T>, A>(p);
-}
-
-template<class T>
-inline ::IceUtilInternal::ConstVoidMemFun<T, Handle<T> >
-constVoidMemFun(void (T::*p)(void) const)
-{
- return ::IceUtilInternal::ConstVoidMemFun<T, Handle<T> >(p);
-}
-
-template<class T, class A>
-inline ::IceUtilInternal::ConstVoidMemFun1<T, Handle<T>, A>
-constVoidMemFun1(void (T::*p)(A) const)
-{
- return ::IceUtilInternal::ConstVoidMemFun1<T, Handle<T>, A>(p);
-}
-
-template<class R, class K, class T>
-inline ::IceUtilInternal::SecondConstMemFun<R, K, T, Handle<T> >
-secondConstMemFun(R (T::*p)(void) const)
-{
- return ::IceUtilInternal::SecondConstMemFun<R, K, T, Handle<T> >(p);
-}
-
-template<class R, class K, class T, class A>
-inline ::IceUtilInternal::SecondConstMemFun1<R, K, T, Handle<T>, A>
-secondConstMemFun1(R (T::*p)(A) const)
-{
- return ::IceUtilInternal::SecondConstMemFun1<R, K, T, Handle<T>, A>(p);
-}
-
-template<class K, class T>
-inline ::IceUtilInternal::SecondConstVoidMemFun<K, T, Handle<T> >
-secondConstVoidMemFun(void (T::*p)(void) const)
-{
- return ::IceUtilInternal::SecondConstVoidMemFun<K, T, Handle<T> >(p);
-}
-
-template<class K, class T, class A>
-inline ::IceUtilInternal::SecondConstVoidMemFun1<K, T, Handle<T>, A>
-secondConstVoidMemFun1(void (T::*p)(A) const)
-{
- return ::IceUtilInternal::SecondConstVoidMemFun1<K, T, Handle<T>, A>(p);
-}
-
-}
-
-// ----------------------------------------------------------------------
-// Extension for STLport: Special versions for bind1st and bind2nd for
-// operations that do not return anything (i.e., return void). Needed
-// for broken compilers, such as Visual C++
-// ----------------------------------------------------------------------
-
-#ifdef _STLP_BEGIN_NAMESPACE
-
-_STLP_BEGIN_NAMESPACE
-
-template <class _Operation>
-class voidbinder1st :
- public unary_function<typename __BINARY_ARG(_Operation,second_argument_type),
- typename __BINARY_ARG(_Operation,result_type) > {
-protected:
- _Operation _M_op;
- typename _Operation::first_argument_type _M_value;
-public:
- voidbinder1st(const _Operation& __x,
- const typename _Operation::first_argument_type& __y)
- : _M_op(__x), _M_value(__y) {}
- typename _Operation::result_type
- operator()(const typename _Operation::second_argument_type& __x) const {
- _M_op(_M_value, __x);
- }
-};
-
-template <class _Operation, class _Tp>
-inline voidbinder1st<_Operation>
-voidbind1st(const _Operation& __fn, const _Tp& __x)
-{
- typedef typename _Operation::first_argument_type _Arg1_type;
- return voidbinder1st<_Operation>(__fn, _Arg1_type(__x));
-}
-
-template <class _Operation>
-class voidbinder2nd
- : public unary_function<typename __BINARY_ARG(_Operation,first_argument_type),
- typename __BINARY_ARG(_Operation,result_type)> {
-protected:
- _Operation _M_op;
- typename _Operation::second_argument_type value;
-public:
- voidbinder2nd(const _Operation& __x,
- const typename _Operation::second_argument_type& __y)
- : _M_op(__x), value(__y) {}
- typename _Operation::result_type
- operator()(const typename _Operation::first_argument_type& __x) const {
- _M_op(__x, value);
- }
-};
-
-template <class _Operation, class _Tp>
-inline voidbinder2nd<_Operation>
-voidbind2nd(const _Operation& __fn, const _Tp& __x)
-{
- typedef typename _Operation::second_argument_type _Arg2_type;
- return voidbinder2nd<_Operation>(__fn, _Arg2_type(__x));
-}
-
-_STLP_END_NAMESPACE
-
-#endif
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_FUNCTIONAL_H +#define ICE_UTIL_FUNCTIONAL_H + +#include <IceUtil/Handle.h> +#include <functional> + +namespace IceUtilInternal +{ + +// ---------------------------------------------------------------------- +// Various function objects that work with handles instead of plain +// pointers. +// ---------------------------------------------------------------------- + +template<class R, class T, class H> +class MemFun : public std::unary_function<H, R> +{ + typedef R (T::*MemberFN)(void); + MemberFN _mfn; + +public: + + explicit MemFun(MemberFN p) : _mfn(p) { } + R operator()(H handle) const + { + return (handle.get() ->* _mfn)(); + } +}; + +template<class R, class T, class H, class A> +class MemFun1 : public std::binary_function<H, A, R> +{ + typedef R (T::*MemberFN)(A); + MemberFN _mfn; + +public: + + explicit MemFun1(MemberFN p) : _mfn(p) { } + R operator()(H handle, A arg) const + { + return (handle.get() ->* _mfn)(arg); + } +}; + +template<class T, class H> +class VoidMemFun : public std::unary_function<H, void> +{ + typedef void (T::*MemberFN)(void); + MemberFN _mfn; + +public: + + explicit VoidMemFun(MemberFN p) : _mfn(p) { } + void operator()(H handle) const + { + (handle.get() ->* _mfn)(); + } +}; + +template<class T, class H, class A> +class VoidMemFun1 : public std::binary_function<H, A, void> +{ + typedef void (T::*MemberFN)(A); + MemberFN _mfn; + +public: + + explicit VoidMemFun1(MemberFN p) : _mfn(p) { } + void operator()(H handle, A arg) const + { + (handle.get() ->* _mfn)(arg); + } +}; + +template<class R, class K, class T, class H> +class SecondMemFun : public std::unary_function<std::pair<K, H>, R> +{ + typedef R (T::*MemberFN)(void); + MemberFN _mfn; + +public: + + explicit SecondMemFun(MemberFN p) : _mfn(p) { } + R operator()(std::pair<K, H> pair) const + { + return (pair.second.get() ->* _mfn)(); + } +}; + +template<class R, class K, class T, class H, class A> +class SecondMemFun1 : public std::binary_function<std::pair<K, H>, A, R> +{ + typedef R (T::*MemberFN)(A); + MemberFN _mfn; + +public: + + explicit SecondMemFun1(MemberFN p) : _mfn(p) { } + R operator()(std::pair<K, H> pair, A arg) const + { + return (pair.second.get() ->* _mfn)(arg); + } +}; + +template<class K, class T, class H> +class SecondVoidMemFun : public std::unary_function<std::pair<K, H>, void> +{ + typedef void (T::*MemberFN)(void); + MemberFN _mfn; + +public: + + explicit SecondVoidMemFun(MemberFN p) : _mfn(p) { } + void operator()(std::pair<K, H> pair) const + { + (pair.second.get() ->* _mfn)(); + } +}; + +template<class K, class T, class H, class A> +class SecondVoidMemFun1 : public std::binary_function<std::pair<K, H>, A, void> +{ + typedef void (T::*MemberFN)(A); + MemberFN _mfn; + +public: + + explicit SecondVoidMemFun1(MemberFN p) : _mfn(p) { } + void operator()(std::pair<K, H> pair, A arg) const + { + (pair.second.get() ->* _mfn)(arg); + } +}; + +template<class R, class T, class H> +class ConstMemFun : public std::unary_function<H, R> +{ + typedef R (T::*MemberFN)(void) const; + MemberFN _mfn; + +public: + + explicit ConstMemFun(MemberFN p) : _mfn(p) { } + R operator()(H handle) const + { + return (handle.get() ->* _mfn)(); + } +}; + +template<class R, class T, class H, class A> +class ConstMemFun1 : public std::binary_function<H, A, R> +{ + typedef R (T::*MemberFN)(A) const; + MemberFN _mfn; + +public: + + explicit ConstMemFun1(MemberFN p) : _mfn(p) { } + R operator()(H handle, A arg) const + { + return (handle.get() ->* _mfn)(arg); + } +}; + +template<class T, class H> +class ConstVoidMemFun : public std::unary_function<H, void> +{ + typedef void (T::*MemberFN)(void) const; + MemberFN _mfn; + +public: + + explicit ConstVoidMemFun(MemberFN p) : _mfn(p) { } + void operator()(H handle) const + { + (handle.get() ->* _mfn)(); + } +}; + +template<class T, class H, class A> +class ConstVoidMemFun1 : public std::binary_function<H, A, void> +{ + typedef void (T::*MemberFN)(A) const; + MemberFN _mfn; + +public: + + explicit ConstVoidMemFun1(MemberFN p) : _mfn(p) { } + void operator()(H handle, A arg) const + { + (handle.get() ->* _mfn)(arg); + } +}; + +template<class R, class K, class T, class H> +class SecondConstMemFun : public std::unary_function<std::pair<K, H>, R> +{ + typedef R (T::*MemberFN)(void) const; + MemberFN _mfn; + +public: + + explicit SecondConstMemFun(MemberFN p) : _mfn(p) { } + R operator()(std::pair<K, H> pair) const + { + return (pair.second.get() ->* _mfn)(); + } +}; + +template<class R, class K, class T, class H, class A> +class SecondConstMemFun1 : public std::binary_function<std::pair<K, H>, A, R> +{ + typedef R (T::*MemberFN)(A) const; + MemberFN _mfn; + +public: + + explicit SecondConstMemFun1(MemberFN p) : _mfn(p) { } + R operator()(std::pair<K, H> pair, A arg) const + { + return (pair.second.get() ->* _mfn)(arg); + } +}; + +template<class K, class T, class H> +class SecondConstVoidMemFun : public std::unary_function<std::pair<K, H>, void> +{ + typedef void (T::*MemberFN)(void) const; + MemberFN _mfn; + +public: + + explicit SecondConstVoidMemFun(MemberFN p) : _mfn(p) { } + void operator()(std::pair<K, H> pair) const + { + (pair.second.get() ->* _mfn)(); + } +}; + +template<class K, class T, class H, class A> +class SecondConstVoidMemFun1 : public std::binary_function<std::pair<K, H>, A, void> +{ + typedef void (T::*MemberFN)(A) const; + MemberFN _mfn; + +public: + + explicit SecondConstVoidMemFun1(MemberFN p) : _mfn(p) { } + void operator()(std::pair<K, H> pair, A arg) const + { + (pair.second.get() ->* _mfn)(arg); + } +}; + +} + +// ---------------------------------------------------------------------- +// Inline functions that return function objects that work with +// IceUtil::Handle +// ---------------------------------------------------------------------- + +namespace IceUtil +{ + +template<class R, class T> +inline ::IceUtilInternal::MemFun<R, T, Handle<T> > +memFun(R (T::*p)(void)) +{ + return ::IceUtilInternal::MemFun<R, T, Handle<T> >(p); +} + +template<class R, class T, class A> +inline ::IceUtilInternal::MemFun1<R, T, Handle<T>, A> +memFun1(R (T::*p)(A)) +{ + return ::IceUtilInternal::MemFun1<R, T, Handle<T>, A>(p); +} + +template<class T> +inline ::IceUtilInternal::VoidMemFun<T, Handle<T> > +voidMemFun(void (T::*p)(void)) +{ + return ::IceUtilInternal::VoidMemFun<T, Handle<T> >(p); +} + +template<class T, class A> +inline ::IceUtilInternal::VoidMemFun1<T, Handle<T>, A> +voidMemFun1(void (T::*p)(A)) +{ + return ::IceUtilInternal::VoidMemFun1<T, Handle<T>, A>(p); +} + +template<class R, class K, class T> +inline ::IceUtilInternal::SecondMemFun<R, K, T, Handle<T> > +secondMemFun(R (T::*p)(void)) +{ + return ::IceUtilInternal::SecondMemFun<R, K, T, Handle<T> >(p); +} + +template<class R, class K, class T, class A> +inline ::IceUtilInternal::SecondMemFun1<R, K, T, Handle<T>, A> +secondMemFun1(R (T::*p)(A)) +{ + return ::IceUtilInternal::SecondMemFun1<R, K, T, Handle<T>, A>(p); +} + +template<class K, class T> +inline ::IceUtilInternal::SecondVoidMemFun<K, T, Handle<T> > +secondVoidMemFun(void (T::*p)(void)) +{ + return ::IceUtilInternal::SecondVoidMemFun<K, T, Handle<T> >(p); +} + +template<class K, class T, class A> +inline ::IceUtilInternal::SecondVoidMemFun1<K, T, Handle<T>, A> +secondVoidMemFun1(void (T::*p)(A)) +{ + return ::IceUtilInternal::SecondVoidMemFun1<K, T, Handle<T>, A>(p); +} + +template<class R, class T> +inline ::IceUtilInternal::ConstMemFun<R, T, Handle<T> > +constMemFun(R (T::*p)(void) const) +{ + return ::IceUtilInternal::ConstMemFun<R, T, Handle<T> >(p); +} + +template<class R, class T, class A> +inline ::IceUtilInternal::ConstMemFun1<R, T, Handle<T>, A> +constMemFun1(R (T::*p)(A) const) +{ + return ::IceUtilInternal::ConstMemFun1<R, T, Handle<T>, A>(p); +} + +template<class T> +inline ::IceUtilInternal::ConstVoidMemFun<T, Handle<T> > +constVoidMemFun(void (T::*p)(void) const) +{ + return ::IceUtilInternal::ConstVoidMemFun<T, Handle<T> >(p); +} + +template<class T, class A> +inline ::IceUtilInternal::ConstVoidMemFun1<T, Handle<T>, A> +constVoidMemFun1(void (T::*p)(A) const) +{ + return ::IceUtilInternal::ConstVoidMemFun1<T, Handle<T>, A>(p); +} + +template<class R, class K, class T> +inline ::IceUtilInternal::SecondConstMemFun<R, K, T, Handle<T> > +secondConstMemFun(R (T::*p)(void) const) +{ + return ::IceUtilInternal::SecondConstMemFun<R, K, T, Handle<T> >(p); +} + +template<class R, class K, class T, class A> +inline ::IceUtilInternal::SecondConstMemFun1<R, K, T, Handle<T>, A> +secondConstMemFun1(R (T::*p)(A) const) +{ + return ::IceUtilInternal::SecondConstMemFun1<R, K, T, Handle<T>, A>(p); +} + +template<class K, class T> +inline ::IceUtilInternal::SecondConstVoidMemFun<K, T, Handle<T> > +secondConstVoidMemFun(void (T::*p)(void) const) +{ + return ::IceUtilInternal::SecondConstVoidMemFun<K, T, Handle<T> >(p); +} + +template<class K, class T, class A> +inline ::IceUtilInternal::SecondConstVoidMemFun1<K, T, Handle<T>, A> +secondConstVoidMemFun1(void (T::*p)(A) const) +{ + return ::IceUtilInternal::SecondConstVoidMemFun1<K, T, Handle<T>, A>(p); +} + +} + +// ---------------------------------------------------------------------- +// Extension for STLport: Special versions for bind1st and bind2nd for +// operations that do not return anything (i.e., return void). Needed +// for broken compilers, such as Visual C++ +// ---------------------------------------------------------------------- + +#ifdef _STLP_BEGIN_NAMESPACE + +_STLP_BEGIN_NAMESPACE + +template <class _Operation> +class voidbinder1st : + public unary_function<typename __BINARY_ARG(_Operation,second_argument_type), + typename __BINARY_ARG(_Operation,result_type) > { +protected: + _Operation _M_op; + typename _Operation::first_argument_type _M_value; +public: + voidbinder1st(const _Operation& __x, + const typename _Operation::first_argument_type& __y) + : _M_op(__x), _M_value(__y) {} + typename _Operation::result_type + operator()(const typename _Operation::second_argument_type& __x) const { + _M_op(_M_value, __x); + } +}; + +template <class _Operation, class _Tp> +inline voidbinder1st<_Operation> +voidbind1st(const _Operation& __fn, const _Tp& __x) +{ + typedef typename _Operation::first_argument_type _Arg1_type; + return voidbinder1st<_Operation>(__fn, _Arg1_type(__x)); +} + +template <class _Operation> +class voidbinder2nd + : public unary_function<typename __BINARY_ARG(_Operation,first_argument_type), + typename __BINARY_ARG(_Operation,result_type)> { +protected: + _Operation _M_op; + typename _Operation::second_argument_type value; +public: + voidbinder2nd(const _Operation& __x, + const typename _Operation::second_argument_type& __y) + : _M_op(__x), value(__y) {} + typename _Operation::result_type + operator()(const typename _Operation::first_argument_type& __x) const { + _M_op(__x, value); + } +}; + +template <class _Operation, class _Tp> +inline voidbinder2nd<_Operation> +voidbind2nd(const _Operation& __fn, const _Tp& __x) +{ + typedef typename _Operation::second_argument_type _Arg2_type; + return voidbinder2nd<_Operation>(__fn, _Arg2_type(__x)); +} + +_STLP_END_NAMESPACE + +#endif + +#endif diff --git a/cpp/include/IceUtil/Handle.h b/cpp/include/IceUtil/Handle.h index b319c86a7e2..060f541d52b 100644 --- a/cpp/include/IceUtil/Handle.h +++ b/cpp/include/IceUtil/Handle.h @@ -1,231 +1,231 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_HANDLE_H
-#define ICE_UTIL_HANDLE_H
-
-#include <IceUtil/Exception.h>
-#include <algorithm>
-
-//
-// "Handle" or "smart pointer" class for classes derived from
-// IceUtil::Shared or IceUtil::SimpleShared.
-//
-namespace IceUtil
-{
-
-template<typename T>
-class HandleBase
-{
-public:
-
- typedef T element_type;
-
- T* get() const
- {
- return _ptr;
- }
-
- T* operator->() const
- {
- if(!_ptr)
- {
- throw NullHandleException(__FILE__, __LINE__);
- }
-
- return _ptr;
- }
-
- operator bool() const
- {
- return _ptr ? true : false;
- }
-
- void swap(HandleBase& other)
- {
- std::swap(_ptr, other._ptr);
- }
-
- T* _ptr;
-};
-
-template<typename T, typename U>
-inline bool operator==(const HandleBase<T>& lhs, const HandleBase<U>& rhs)
-{
- T* l = lhs.get();
- U* r = rhs.get();
- if(l && r)
- {
- return *l == *r;
- }
- else
- {
- return !l && !r;
- }
-}
-
-template<typename T, typename U>
-inline bool operator!=(const HandleBase<T>& lhs, const HandleBase<U>& rhs)
-{
- T* l = lhs.get();
- U* r = rhs.get();
- if(l && r)
- {
- return *l != *r;
- }
- else
- {
- return l || r;
- }
-}
-
-template<typename T, typename U>
-inline bool operator<(const HandleBase<T>& lhs, const HandleBase<U>& rhs)
-{
- T* l = lhs.get();
- U* r = rhs.get();
- if(l && r)
- {
- return *l < *r;
- }
- else
- {
- return !l && r;
- }
-}
-
-template<typename T>
-class Handle : public HandleBase<T>
-{
-public:
-
- Handle(T* p = 0)
- {
- _ptr = p;
-
- if(_ptr)
- {
- _ptr->__incRef();
- }
- }
-
- template<typename Y>
- Handle(const Handle<Y>& r)
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- _ptr->__incRef();
- }
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- Handle(const Handle<T>& r)
-#else
- Handle(const Handle& r)
-#endif
- {
- _ptr = r._ptr;
-
- if(_ptr)
- {
- _ptr->__incRef();
- }
- }
-
- ~Handle()
- {
- if(_ptr)
- {
- _ptr->__decRef();
- }
- }
-
- Handle& operator=(T* p)
- {
- if(_ptr != p)
- {
- if(p)
- {
- p->__incRef();
- }
-
- if(_ptr)
- {
- _ptr->__decRef();
- }
-
- _ptr = p;
- }
- return *this;
- }
-
- template<typename Y>
- Handle& operator=(const Handle<Y>& r)
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- r._ptr->__incRef();
- }
-
- if(_ptr)
- {
- _ptr->__decRef();
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
-#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here???
- template<>
- Handle& operator=(const Handle<T>& r)
-#else
- Handle& operator=(const Handle& r)
-#endif
- {
- if(_ptr != r._ptr)
- {
- if(r._ptr)
- {
- r._ptr->__incRef();
- }
-
- if(_ptr)
- {
- _ptr->__decRef();
- }
-
- _ptr = r._ptr;
- }
- return *this;
- }
-
- template<class Y>
- static Handle dynamicCast(const HandleBase<Y>& r)
- {
- return Handle(dynamic_cast<T*>(r._ptr));
- }
-
- template<class Y>
- static Handle dynamicCast(Y* p)
- {
- return Handle(dynamic_cast<T*>(p));
- }
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_HANDLE_H +#define ICE_UTIL_HANDLE_H + +#include <IceUtil/Exception.h> +#include <algorithm> + +// +// "Handle" or "smart pointer" class for classes derived from +// IceUtil::Shared or IceUtil::SimpleShared. +// +namespace IceUtil +{ + +template<typename T> +class HandleBase +{ +public: + + typedef T element_type; + + T* get() const + { + return _ptr; + } + + T* operator->() const + { + if(!_ptr) + { + throw NullHandleException(__FILE__, __LINE__); + } + + return _ptr; + } + + operator bool() const + { + return _ptr ? true : false; + } + + void swap(HandleBase& other) + { + std::swap(_ptr, other._ptr); + } + + T* _ptr; +}; + +template<typename T, typename U> +inline bool operator==(const HandleBase<T>& lhs, const HandleBase<U>& rhs) +{ + T* l = lhs.get(); + U* r = rhs.get(); + if(l && r) + { + return *l == *r; + } + else + { + return !l && !r; + } +} + +template<typename T, typename U> +inline bool operator!=(const HandleBase<T>& lhs, const HandleBase<U>& rhs) +{ + T* l = lhs.get(); + U* r = rhs.get(); + if(l && r) + { + return *l != *r; + } + else + { + return l || r; + } +} + +template<typename T, typename U> +inline bool operator<(const HandleBase<T>& lhs, const HandleBase<U>& rhs) +{ + T* l = lhs.get(); + U* r = rhs.get(); + if(l && r) + { + return *l < *r; + } + else + { + return !l && r; + } +} + +template<typename T> +class Handle : public HandleBase<T> +{ +public: + + Handle(T* p = 0) + { + _ptr = p; + + if(_ptr) + { + _ptr->__incRef(); + } + } + + template<typename Y> + Handle(const Handle<Y>& r) + { + _ptr = r._ptr; + + if(_ptr) + { + _ptr->__incRef(); + } + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + Handle(const Handle<T>& r) +#else + Handle(const Handle& r) +#endif + { + _ptr = r._ptr; + + if(_ptr) + { + _ptr->__incRef(); + } + } + + ~Handle() + { + if(_ptr) + { + _ptr->__decRef(); + } + } + + Handle& operator=(T* p) + { + if(_ptr != p) + { + if(p) + { + p->__incRef(); + } + + if(_ptr) + { + _ptr->__decRef(); + } + + _ptr = p; + } + return *this; + } + + template<typename Y> + Handle& operator=(const Handle<Y>& r) + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + r._ptr->__incRef(); + } + + if(_ptr) + { + _ptr->__decRef(); + } + + _ptr = r._ptr; + } + return *this; + } + +#ifdef _WIN32 // COMPILERBUG: Is VC++ or GNU C++ right here??? + template<> + Handle& operator=(const Handle<T>& r) +#else + Handle& operator=(const Handle& r) +#endif + { + if(_ptr != r._ptr) + { + if(r._ptr) + { + r._ptr->__incRef(); + } + + if(_ptr) + { + _ptr->__decRef(); + } + + _ptr = r._ptr; + } + return *this; + } + + template<class Y> + static Handle dynamicCast(const HandleBase<Y>& r) + { + return Handle(dynamic_cast<T*>(r._ptr)); + } + + template<class Y> + static Handle dynamicCast(Y* p) + { + return Handle(dynamic_cast<T*>(p)); + } +}; + +} + +#endif diff --git a/cpp/include/IceUtil/IceUtil.h b/cpp/include/IceUtil/IceUtil.h index 9f671469bd2..e06213d0810 100644 --- a/cpp/include/IceUtil/IceUtil.h +++ b/cpp/include/IceUtil/IceUtil.h @@ -1,30 +1,30 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_ICE_UTIL_H
-#define ICE_UTIL_ICE_UTIL_H
-
-//
-// This file must include *all* other headers of IceUtil.
-//
-
-#include <IceUtil/Functional.h>
-#include <IceUtil/Shared.h>
-#include <IceUtil/Unicode.h>
-#include <IceUtil/UUID.h>
-#include <IceUtil/Mutex.h>
-#include <IceUtil/RecMutex.h>
-#include <IceUtil/RWRecMutex.h>
-#include <IceUtil/Monitor.h>
-#include <IceUtil/Thread.h>
-#include <IceUtil/Base64.h>
-#include <IceUtil/Time.h>
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_ICE_UTIL_H +#define ICE_UTIL_ICE_UTIL_H + +// +// This file must include *all* other headers of IceUtil. +// + +#include <IceUtil/Functional.h> +#include <IceUtil/Shared.h> +#include <IceUtil/Unicode.h> +#include <IceUtil/UUID.h> +#include <IceUtil/Mutex.h> +#include <IceUtil/RecMutex.h> +#include <IceUtil/RWRecMutex.h> +#include <IceUtil/Monitor.h> +#include <IceUtil/Thread.h> +#include <IceUtil/Base64.h> +#include <IceUtil/Time.h> + +#endif diff --git a/cpp/include/IceUtil/Lock.h b/cpp/include/IceUtil/Lock.h index 610091a12a1..d5b9d2ca14b 100644 --- a/cpp/include/IceUtil/Lock.h +++ b/cpp/include/IceUtil/Lock.h @@ -1,72 +1,72 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_LOCK_H
-#define ICE_UTIL_LOCK_H
-
-#include <IceUtil/Config.h>
-
-namespace IceUtil
-{
-
-//
-// Forward declarations.
-//
-class Cond;
-
-template <typename T>
-class Lock
-{
-public:
-
- Lock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.lock();
- }
-
- ~Lock()
- {
- _mutex.unlock();
- }
-
-private:
-
- const T& _mutex;
-
- friend class Cond;
-};
-
-template <typename T>
-class TryLock
-{
-public:
-
- TryLock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.trylock();
- }
-
- ~TryLock()
- {
- _mutex.unlock();
- }
-
-private:
-
- const T& _mutex;
-
- friend class Cond;
-};
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_LOCK_H +#define ICE_UTIL_LOCK_H + +#include <IceUtil/Config.h> + +namespace IceUtil +{ + +// +// Forward declarations. +// +class Cond; + +template <typename T> +class Lock +{ +public: + + Lock(const T& mutex) : + _mutex(mutex) + { + _mutex.lock(); + } + + ~Lock() + { + _mutex.unlock(); + } + +private: + + const T& _mutex; + + friend class Cond; +}; + +template <typename T> +class TryLock +{ +public: + + TryLock(const T& mutex) : + _mutex(mutex) + { + _mutex.trylock(); + } + + ~TryLock() + { + _mutex.unlock(); + } + +private: + + const T& _mutex; + + friend class Cond; +}; + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/Monitor.h b/cpp/include/IceUtil/Monitor.h index aba1a29fd6e..ed2390f00d1 100644 --- a/cpp/include/IceUtil/Monitor.h +++ b/cpp/include/IceUtil/Monitor.h @@ -1,235 +1,235 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_MONITOR_H
-#define ICE_UTIL_MONITOR_H
-
-#include <IceUtil/Config.h>
-#include <IceUtil/Lock.h>
-#include <IceUtil/Cond.h>
-
-namespace IceUtil
-{
-
-//
-// This monitor implements the Mesa monitor semantics. That is any
-// calls to notify() or notifyAll() are delayed until the monitor is
-// unlocked.
-//
-template <class T>
-class ICE_UTIL_API Monitor
-{
-public:
-
- typedef Lock<Monitor<T> > Lock;
- typedef TryLock<Monitor<T> > TryLock;
-
- Monitor();
- ~Monitor();
-
- //
- // Note that lock/trylock & unlock in general should not be used
- // directly. Instead use Lock & TryLock.
- //
- void lock() const;
- void unlock() const;
- void trylock() const;
-
- void wait() const;
- bool timedWait(const Time&) const;
- void notify();
- void notifyAll();
-
-private:
-
- // noncopyable
- Monitor(const Monitor&);
- void operator=(const Monitor&);
-
- void notifyImpl(int) const;
-
- mutable Cond _cond;
- T _mutex;
- mutable int _nnotify;
-};
-
-} // End namespace IceUtil
-
-//
-// Since this monitor implements the Mesa monitor semantics calls to
-// notify() or notifyAll() are delayed until the monitor is
-// unlocked. This can happen either due to a call to unlock(), or a
-// call to wait(). The _nnotify flag keeps track of the number of
-// pending notification calls. -1 indicates a broadcast, a positive
-// number indicates <n> calls to notify(). The _nnotify flag is reset
-// upon initial acquisition of the monitor lock (either through a call
-// to lock(), or a return from wait().
-//
-
-template <class T> inline
-IceUtil::Monitor<T>::Monitor() :
- _nnotify(0)
-{
-}
-
-template <class T> inline
-IceUtil::Monitor<T>::~Monitor()
-{
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::lock() const
-{
- if(_mutex.lock())
- {
- //
- // On the first mutex acquisition reset the number pending
- // notifications.
- //
- _nnotify = 0;
- }
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::unlock() const
-{
- int nnotify = _nnotify;
- if(_mutex.unlock())
- {
- //
- // Perform any pending notifications.
- //
- notifyImpl(nnotify);
- }
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::trylock() const
-{
- if(_mutex.trylock())
- {
- //
- // On the first mutex acquisition reset the number pending
- // notifications.
- //
- _nnotify = 0;
- }
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::wait() const
-{
- //
- // Perform any pending notifies
- //
- notifyImpl(_nnotify);
-
- //
- // Wait for a notification
- //
- try
- {
- _cond.waitImpl(_mutex);
- //
- // Reset the nnotify count once wait() returns.
- //
- }
- catch(...)
- {
- _nnotify = 0;
- throw;
- }
- _nnotify = 0;
-}
-
-template <class T> inline bool
-IceUtil::Monitor<T>::timedWait(const Time& timeout) const
-{
- //
- // Perform any pending notifies.
- //
- notifyImpl(_nnotify);
-
- bool rc;
- //
- // Wait for a notification.
- //
- try
- {
- rc = _cond.timedWaitImpl(_mutex, timeout);
-
- //
- // Reset the nnotify count once wait() returns.
- //
- }
- catch(...)
- {
- _nnotify = 0;
- throw;
- }
-
- _nnotify = 0;
- return rc;
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::notify()
-{
- //
- // Increment the _nnotify flag, unless a broadcast has already
- // been requested.
- //
- if(_nnotify != -1)
- {
- ++_nnotify;
- }
-}
-
-template <class T> inline void
-IceUtil::Monitor<T>::notifyAll()
-{
- //
- // -1 (indicates broadcast)
- //
- _nnotify = -1;
-}
-
-
-template <class T> inline void
-IceUtil::Monitor<T>::notifyImpl(int nnotify) const
-{
- //
- // Zero indicates no notifies.
- //
- if(nnotify != 0)
- {
- //
- // -1 means notifyAll.
- //
- if(nnotify == -1)
- {
- _cond.broadcast();
- return;
- }
- else
- {
- //
- // Otherwise notify n times.
- //
- while(nnotify > 0)
- {
- _cond.signal();
- --nnotify;
- }
- }
- }
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_MONITOR_H +#define ICE_UTIL_MONITOR_H + +#include <IceUtil/Config.h> +#include <IceUtil/Lock.h> +#include <IceUtil/Cond.h> + +namespace IceUtil +{ + +// +// This monitor implements the Mesa monitor semantics. That is any +// calls to notify() or notifyAll() are delayed until the monitor is +// unlocked. +// +template <class T> +class ICE_UTIL_API Monitor +{ +public: + + typedef Lock<Monitor<T> > Lock; + typedef TryLock<Monitor<T> > TryLock; + + Monitor(); + ~Monitor(); + + // + // Note that lock/trylock & unlock in general should not be used + // directly. Instead use Lock & TryLock. + // + void lock() const; + void unlock() const; + void trylock() const; + + void wait() const; + bool timedWait(const Time&) const; + void notify(); + void notifyAll(); + +private: + + // noncopyable + Monitor(const Monitor&); + void operator=(const Monitor&); + + void notifyImpl(int) const; + + mutable Cond _cond; + T _mutex; + mutable int _nnotify; +}; + +} // End namespace IceUtil + +// +// Since this monitor implements the Mesa monitor semantics calls to +// notify() or notifyAll() are delayed until the monitor is +// unlocked. This can happen either due to a call to unlock(), or a +// call to wait(). The _nnotify flag keeps track of the number of +// pending notification calls. -1 indicates a broadcast, a positive +// number indicates <n> calls to notify(). The _nnotify flag is reset +// upon initial acquisition of the monitor lock (either through a call +// to lock(), or a return from wait(). +// + +template <class T> inline +IceUtil::Monitor<T>::Monitor() : + _nnotify(0) +{ +} + +template <class T> inline +IceUtil::Monitor<T>::~Monitor() +{ +} + +template <class T> inline void +IceUtil::Monitor<T>::lock() const +{ + if(_mutex.lock()) + { + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; + } +} + +template <class T> inline void +IceUtil::Monitor<T>::unlock() const +{ + int nnotify = _nnotify; + if(_mutex.unlock()) + { + // + // Perform any pending notifications. + // + notifyImpl(nnotify); + } +} + +template <class T> inline void +IceUtil::Monitor<T>::trylock() const +{ + if(_mutex.trylock()) + { + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; + } +} + +template <class T> inline void +IceUtil::Monitor<T>::wait() const +{ + // + // Perform any pending notifies + // + notifyImpl(_nnotify); + + // + // Wait for a notification + // + try + { + _cond.waitImpl(_mutex); + // + // Reset the nnotify count once wait() returns. + // + } + catch(...) + { + _nnotify = 0; + throw; + } + _nnotify = 0; +} + +template <class T> inline bool +IceUtil::Monitor<T>::timedWait(const Time& timeout) const +{ + // + // Perform any pending notifies. + // + notifyImpl(_nnotify); + + bool rc; + // + // Wait for a notification. + // + try + { + rc = _cond.timedWaitImpl(_mutex, timeout); + + // + // Reset the nnotify count once wait() returns. + // + } + catch(...) + { + _nnotify = 0; + throw; + } + + _nnotify = 0; + return rc; +} + +template <class T> inline void +IceUtil::Monitor<T>::notify() +{ + // + // Increment the _nnotify flag, unless a broadcast has already + // been requested. + // + if(_nnotify != -1) + { + ++_nnotify; + } +} + +template <class T> inline void +IceUtil::Monitor<T>::notifyAll() +{ + // + // -1 (indicates broadcast) + // + _nnotify = -1; +} + + +template <class T> inline void +IceUtil::Monitor<T>::notifyImpl(int nnotify) const +{ + // + // Zero indicates no notifies. + // + if(nnotify != 0) + { + // + // -1 means notifyAll. + // + if(nnotify == -1) + { + _cond.broadcast(); + return; + } + else + { + // + // Otherwise notify n times. + // + while(nnotify > 0) + { + _cond.signal(); + --nnotify; + } + } + } +} + +#endif diff --git a/cpp/include/IceUtil/Mutex.h b/cpp/include/IceUtil/Mutex.h index d9298bbf774..c5553901323 100644 --- a/cpp/include/IceUtil/Mutex.h +++ b/cpp/include/IceUtil/Mutex.h @@ -1,250 +1,250 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_MUTEX_H
-#define ICE_UTIL_MUTEX_H
-
-#include <IceUtil/Config.h>
-#include <IceUtil/Exception.h> // Necessary for inline functions
-#include <IceUtil/Lock.h>
-
-namespace IceUtil
-{
-
-//
-// Forward declaration for friend.
-//
-class Cond;
-
-//
-// Simple non-recursive Mutex implementation.
-//
-// Don't use noncopyable otherwise you end up with warnings like this:
-//
-// In file included from Connection.cpp:20:
-// ../../include/Ice/Outgoing.h:88: warning: direct base
-// `IceUtil::noncopyable' inaccessible in `IceInternal::Outgoing' due
-// to ambiguity
-//
-class ICE_UTIL_API Mutex
-{
-public:
-
- //
- // Lock & TryLock typedefs.
- //
- typedef Lock<Mutex> Lock;
- typedef TryLock<Mutex> TryLock;
-
- Mutex();
- ~Mutex();
-
- //
- // Note that lock/trylock & unlock in general should not be used
- // directly. Instead use Lock & TryLock.
- //
-
- //
- // The boolean values are for the Monitor implementation which
- // needs to know whether the Mutex has been locked for the first
- // time, or unlocked for the last time (that is another thread is
- // able to acquire the mutex).
- //
-
- //
- // Return true if the mutex has been locked for the first time.
- //
- bool lock() const;
-
- //
- // Throw LockedException in the case that the lock call would
- // block (that is the mutex is already owned by some other
- // thread). Returns true if the mutex has been locked for the
- // first time.
- //
- bool trylock() const;
-
- //
- // Returns true if the mutex has been unlocked for the last time
- // (false otherwise).
- //
- bool unlock() const;
-
-private:
-
- // noncopyable
- Mutex(const Mutex&);
- void operator=(const Mutex&);
-
- //
- // LockState and the lock/unlock variations are for use by the
- // Condition variable implementation.
- //
-#ifdef _WIN32
- struct LockState
- {
- };
-#else
- struct LockState
- {
- pthread_mutex_t* mutex;
- };
-#endif
-
- void unlock(LockState&) const;
- void lock(LockState&) const;
-
- friend class Cond;
-
-#ifdef _WIN32
- mutable CRITICAL_SECTION _mutex;
-#else
- mutable pthread_mutex_t _mutex;
-#endif
-};
-
-//
-// For performance reasons the following functions are inlined.
-//
-
-#ifdef _WIN32
-
-inline
-Mutex::Mutex()
-{
- InitializeCriticalSection(&_mutex);
-}
-
-inline
-Mutex::~Mutex()
-{
- DeleteCriticalSection(&_mutex);
-}
-
-inline bool
-Mutex::lock() const
-{
- EnterCriticalSection(&_mutex);
- //
- // If necessary this can be removed and replaced with a _count
- // member (like the UNIX implementation of RecMutex).
- //
- assert(_mutex.RecursionCount == 1);
- return true;
-}
-
-inline bool
-Mutex::trylock() const
-{
- if(!TryEnterCriticalSection(&_mutex))
- {
- throw LockedException(__FILE__, __LINE__);
- }
- if(_mutex.RecursionCount > 1)
- {
- LeaveCriticalSection(&_mutex);
- throw LockedException(__FILE__, __LINE__);
- }
- return true;
-}
-
-inline bool
-Mutex::unlock() const
-{
- assert(_mutex.RecursionCount == 1);
- LeaveCriticalSection(&_mutex);
- return true;
-}
-
-inline void
-Mutex::unlock(LockState& state) const
-{
- LeaveCriticalSection(&_mutex);
-}
-
-inline void
-Mutex::lock(LockState&) const
-{
- EnterCriticalSection(&_mutex);
-}
-
-#else
-
-inline
-Mutex::Mutex()
-{
- int rc = pthread_mutex_init(&_mutex, 0);
- if(rc != 0)
- {
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
-}
-
-inline
-Mutex::~Mutex()
-{
- int rc = 0;
- rc = pthread_mutex_destroy(&_mutex);
- assert(rc == 0);
-}
-
-inline bool
-Mutex::lock() const
-{
- int rc = pthread_mutex_lock(&_mutex);
- if(rc != 0)
- {
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
- return true;
-}
-
-inline bool
-Mutex::trylock() const
-{
- int rc = pthread_mutex_trylock(&_mutex);
- if(rc != 0)
- {
- if(rc == EBUSY)
- {
- throw LockedException(__FILE__, __LINE__);
- }
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
- return true;
-}
-
-inline bool
-Mutex::unlock() const
-{
- int rc = pthread_mutex_unlock(&_mutex);
- if(rc != 0)
- {
- throw SyscallException(strerror(rc), __FILE__, __LINE__);
- }
- return true;
-}
-
-inline void
-Mutex::unlock(LockState& state) const
-{
- state.mutex = &_mutex;
-}
-
-inline void
-Mutex::lock(LockState&) const
-{
-}
-
-#endif
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_MUTEX_H +#define ICE_UTIL_MUTEX_H + +#include <IceUtil/Config.h> +#include <IceUtil/Exception.h> // Necessary for inline functions +#include <IceUtil/Lock.h> + +namespace IceUtil +{ + +// +// Forward declaration for friend. +// +class Cond; + +// +// Simple non-recursive Mutex implementation. +// +// Don't use noncopyable otherwise you end up with warnings like this: +// +// In file included from Connection.cpp:20: +// ../../include/Ice/Outgoing.h:88: warning: direct base +// `IceUtil::noncopyable' inaccessible in `IceInternal::Outgoing' due +// to ambiguity +// +class ICE_UTIL_API Mutex +{ +public: + + // + // Lock & TryLock typedefs. + // + typedef Lock<Mutex> Lock; + typedef TryLock<Mutex> TryLock; + + Mutex(); + ~Mutex(); + + // + // Note that lock/trylock & unlock in general should not be used + // directly. Instead use Lock & TryLock. + // + + // + // The boolean values are for the Monitor implementation which + // needs to know whether the Mutex has been locked for the first + // time, or unlocked for the last time (that is another thread is + // able to acquire the mutex). + // + + // + // Return true if the mutex has been locked for the first time. + // + bool lock() const; + + // + // Throw LockedException in the case that the lock call would + // block (that is the mutex is already owned by some other + // thread). Returns true if the mutex has been locked for the + // first time. + // + bool trylock() const; + + // + // Returns true if the mutex has been unlocked for the last time + // (false otherwise). + // + bool unlock() const; + +private: + + // noncopyable + Mutex(const Mutex&); + void operator=(const Mutex&); + + // + // LockState and the lock/unlock variations are for use by the + // Condition variable implementation. + // +#ifdef _WIN32 + struct LockState + { + }; +#else + struct LockState + { + pthread_mutex_t* mutex; + }; +#endif + + void unlock(LockState&) const; + void lock(LockState&) const; + + friend class Cond; + +#ifdef _WIN32 + mutable CRITICAL_SECTION _mutex; +#else + mutable pthread_mutex_t _mutex; +#endif +}; + +// +// For performance reasons the following functions are inlined. +// + +#ifdef _WIN32 + +inline +Mutex::Mutex() +{ + InitializeCriticalSection(&_mutex); +} + +inline +Mutex::~Mutex() +{ + DeleteCriticalSection(&_mutex); +} + +inline bool +Mutex::lock() const +{ + EnterCriticalSection(&_mutex); + // + // If necessary this can be removed and replaced with a _count + // member (like the UNIX implementation of RecMutex). + // + assert(_mutex.RecursionCount == 1); + return true; +} + +inline bool +Mutex::trylock() const +{ + if(!TryEnterCriticalSection(&_mutex)) + { + throw LockedException(__FILE__, __LINE__); + } + if(_mutex.RecursionCount > 1) + { + LeaveCriticalSection(&_mutex); + throw LockedException(__FILE__, __LINE__); + } + return true; +} + +inline bool +Mutex::unlock() const +{ + assert(_mutex.RecursionCount == 1); + LeaveCriticalSection(&_mutex); + return true; +} + +inline void +Mutex::unlock(LockState& state) const +{ + LeaveCriticalSection(&_mutex); +} + +inline void +Mutex::lock(LockState&) const +{ + EnterCriticalSection(&_mutex); +} + +#else + +inline +Mutex::Mutex() +{ + int rc = pthread_mutex_init(&_mutex, 0); + if(rc != 0) + { + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } +} + +inline +Mutex::~Mutex() +{ + int rc = 0; + rc = pthread_mutex_destroy(&_mutex); + assert(rc == 0); +} + +inline bool +Mutex::lock() const +{ + int rc = pthread_mutex_lock(&_mutex); + if(rc != 0) + { + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } + return true; +} + +inline bool +Mutex::trylock() const +{ + int rc = pthread_mutex_trylock(&_mutex); + if(rc != 0) + { + if(rc == EBUSY) + { + throw LockedException(__FILE__, __LINE__); + } + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } + return true; +} + +inline bool +Mutex::unlock() const +{ + int rc = pthread_mutex_unlock(&_mutex); + if(rc != 0) + { + throw SyscallException(strerror(rc), __FILE__, __LINE__); + } + return true; +} + +inline void +Mutex::unlock(LockState& state) const +{ + state.mutex = &_mutex; +} + +inline void +Mutex::lock(LockState&) const +{ +} + +#endif + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/OutputUtil.h b/cpp/include/IceUtil/OutputUtil.h index f0ad953c21c..61ce7916949 100644 --- a/cpp/include/IceUtil/OutputUtil.h +++ b/cpp/include/IceUtil/OutputUtil.h @@ -1,261 +1,261 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_OUTPUT_UTIL_H
-#define ICE_UTIL_OUTPUT_UTIL_H
-
-#include <IceUtil/Config.h>
-#include <fstream>
-#include <stack>
-
-namespace IceUtil
-{
-
-// ----------------------------------------------------------------------
-// OutputBase
-// ----------------------------------------------------------------------
-
-//
-// Technically it's not necessary to have print() & nl() as virtual
-// since the opeator<< functions are specific to each OutputBase
-// derivative. However, since it's possible to call print() & nl()
-// manually I've decided to leave them as virtual.
-//
-
-class ICE_UTIL_API OutputBase : public ::IceUtil::noncopyable
-{
-public:
-
- OutputBase();
- OutputBase(std::ostream&);
- OutputBase(const char*);
- virtual ~OutputBase();
-
- void setIndent(int); // What is the indent level?
- void setUseTab(bool); // Should we output tabs?
-
- void open(const char*); // Open output stream.
-
- virtual void print(const char*); // Print a string.
-
- void inc(); // Increment indentation level.
- void dec(); // Decrement indentation level.
-
- void useCurrentPosAsIndent(); // Save the current position as indentation.
- void zeroIndent(); // Use zero identation.
- void restoreIndent(); // Restore indentation.
-
- virtual void nl(); // Print newline.
- void sp(); // Print separator.
-
- bool operator!() const; // Check whether the output state is ok.
-
-protected:
-
- std::ofstream _fout;
- std::ostream& _out;
- int _pos;
- int _indent;
- int _indentSize;
- std::stack<int> _indentSave;
- bool _useTab;
- bool _separator;
-};
-
-class ICE_UTIL_API NextLine
-{
-};
-extern ICE_UTIL_API NextLine nl;
-
-class ICE_UTIL_API Separator
-{
-};
-extern ICE_UTIL_API Separator sp;
-
-// ----------------------------------------------------------------------
-// Output
-// ----------------------------------------------------------------------
-
-class ICE_UTIL_API Output : public OutputBase
-{
-public:
-
- Output();
- Output(std::ostream&);
- Output(const char*);
-
- void setBeginBlock(const char *); // what do we use at block starts?
- void setEndBlock(const char *); // what do we use the block end?
-
- void sb(); // Start a block.
- void eb(); // End a block.
-
-private:
-
- std::string _blockStart;
- std::string _blockEnd;
-};
-
-template<typename T>
-Output&
-operator<<(Output& out, const T& val)
-{
- std::ostringstream s;
- s << val;
- out.print(s.str().c_str());
- return out;
-}
-
-template<>
-inline Output&
-operator<<(Output& o, const NextLine&)
-{
- o.nl();
- return o;
-}
-
-template<>
-inline Output&
-operator<<(Output& o, const Separator&)
-{
- o.sp();
- return o;
-}
-
-class ICE_UTIL_API StartBlock
-{
-};
-extern ICE_UTIL_API StartBlock sb;
-
-template<>
-inline Output&
-operator<<(Output& o, const StartBlock&)
-{
- o.sb();
- return o;
-}
-
-class ICE_UTIL_API EndBlock
-{
-};
-extern ICE_UTIL_API EndBlock eb;
-
-template<>
-inline Output&
-operator<<(Output& o, const EndBlock&)
-{
- o.eb();
- return o;
-}
-
-ICE_UTIL_API Output& operator<<(Output&, std::ios_base& (*)(std::ios_base&));
-
-// ----------------------------------------------------------------------
-// XMLOutput
-// ----------------------------------------------------------------------
-
-class ICE_UTIL_API XMLOutput : public OutputBase
-{
-public:
-
- XMLOutput();
- XMLOutput(std::ostream&);
- XMLOutput(const char*);
-
- void setSGML(bool);
- virtual void print(const char*); // Print a string.
-
- virtual void nl(); // Print newline.
-
- void se(const std::string&); // Start an element.
- void ee(); // End an element.
-
-private:
-
- std::stack<std::string> _elementStack;
- bool _printed;
- bool _sgml;
-};
-
-template<typename T>
-XMLOutput&
-operator<<(XMLOutput& out, const T& val)
-{
- std::ostringstream s;
- s << val;
- out.print(s.str().c_str());
- return out;
-}
-
-template<>
-inline XMLOutput&
-operator<<(XMLOutput& o, const NextLine&)
-{
- o.nl();
- return o;
-}
-
-template<>
-inline XMLOutput&
-operator<<(XMLOutput& o, const Separator&)
-{
- o.sp();
- return o;
-}
-
-// TODO: Not performance critical, does not need to be inlined.
-class ICE_UTIL_API StartElement
-{
-public:
-
- StartElement(const std::string& name) :
- _name(name)
- {
- }
-
- ~StartElement()
- {
- }
-
- const std::string& getName() const
- {
- return _name;
- }
-
-private:
-
- const std::string _name;
-};
-typedef StartElement se;
-
-template<>
-inline XMLOutput&
-operator<<(XMLOutput& o, const StartElement& e)
-{
- o.se(e.getName());
- return o;
-}
-
-class ICE_UTIL_API EndElement { };
-extern ICE_UTIL_API EndElement ee;
-
-template<>
-inline XMLOutput&
-operator<<(XMLOutput& o, const EndElement&)
-{
- o.ee();
- return o;
-}
-
-ICE_UTIL_API XMLOutput& operator<<(XMLOutput&, std::ios_base& (*)(std::ios_base&));
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_OUTPUT_UTIL_H +#define ICE_UTIL_OUTPUT_UTIL_H + +#include <IceUtil/Config.h> +#include <fstream> +#include <stack> + +namespace IceUtil +{ + +// ---------------------------------------------------------------------- +// OutputBase +// ---------------------------------------------------------------------- + +// +// Technically it's not necessary to have print() & nl() as virtual +// since the opeator<< functions are specific to each OutputBase +// derivative. However, since it's possible to call print() & nl() +// manually I've decided to leave them as virtual. +// + +class ICE_UTIL_API OutputBase : public ::IceUtil::noncopyable +{ +public: + + OutputBase(); + OutputBase(std::ostream&); + OutputBase(const char*); + virtual ~OutputBase(); + + void setIndent(int); // What is the indent level? + void setUseTab(bool); // Should we output tabs? + + void open(const char*); // Open output stream. + + virtual void print(const char*); // Print a string. + + void inc(); // Increment indentation level. + void dec(); // Decrement indentation level. + + void useCurrentPosAsIndent(); // Save the current position as indentation. + void zeroIndent(); // Use zero identation. + void restoreIndent(); // Restore indentation. + + virtual void nl(); // Print newline. + void sp(); // Print separator. + + bool operator!() const; // Check whether the output state is ok. + +protected: + + std::ofstream _fout; + std::ostream& _out; + int _pos; + int _indent; + int _indentSize; + std::stack<int> _indentSave; + bool _useTab; + bool _separator; +}; + +class ICE_UTIL_API NextLine +{ +}; +extern ICE_UTIL_API NextLine nl; + +class ICE_UTIL_API Separator +{ +}; +extern ICE_UTIL_API Separator sp; + +// ---------------------------------------------------------------------- +// Output +// ---------------------------------------------------------------------- + +class ICE_UTIL_API Output : public OutputBase +{ +public: + + Output(); + Output(std::ostream&); + Output(const char*); + + void setBeginBlock(const char *); // what do we use at block starts? + void setEndBlock(const char *); // what do we use the block end? + + void sb(); // Start a block. + void eb(); // End a block. + +private: + + std::string _blockStart; + std::string _blockEnd; +}; + +template<typename T> +Output& +operator<<(Output& out, const T& val) +{ + std::ostringstream s; + s << val; + out.print(s.str().c_str()); + return out; +} + +template<> +inline Output& +operator<<(Output& o, const NextLine&) +{ + o.nl(); + return o; +} + +template<> +inline Output& +operator<<(Output& o, const Separator&) +{ + o.sp(); + return o; +} + +class ICE_UTIL_API StartBlock +{ +}; +extern ICE_UTIL_API StartBlock sb; + +template<> +inline Output& +operator<<(Output& o, const StartBlock&) +{ + o.sb(); + return o; +} + +class ICE_UTIL_API EndBlock +{ +}; +extern ICE_UTIL_API EndBlock eb; + +template<> +inline Output& +operator<<(Output& o, const EndBlock&) +{ + o.eb(); + return o; +} + +ICE_UTIL_API Output& operator<<(Output&, std::ios_base& (*)(std::ios_base&)); + +// ---------------------------------------------------------------------- +// XMLOutput +// ---------------------------------------------------------------------- + +class ICE_UTIL_API XMLOutput : public OutputBase +{ +public: + + XMLOutput(); + XMLOutput(std::ostream&); + XMLOutput(const char*); + + void setSGML(bool); + virtual void print(const char*); // Print a string. + + virtual void nl(); // Print newline. + + void se(const std::string&); // Start an element. + void ee(); // End an element. + +private: + + std::stack<std::string> _elementStack; + bool _printed; + bool _sgml; +}; + +template<typename T> +XMLOutput& +operator<<(XMLOutput& out, const T& val) +{ + std::ostringstream s; + s << val; + out.print(s.str().c_str()); + return out; +} + +template<> +inline XMLOutput& +operator<<(XMLOutput& o, const NextLine&) +{ + o.nl(); + return o; +} + +template<> +inline XMLOutput& +operator<<(XMLOutput& o, const Separator&) +{ + o.sp(); + return o; +} + +// TODO: Not performance critical, does not need to be inlined. +class ICE_UTIL_API StartElement +{ +public: + + StartElement(const std::string& name) : + _name(name) + { + } + + ~StartElement() + { + } + + const std::string& getName() const + { + return _name; + } + +private: + + const std::string _name; +}; +typedef StartElement se; + +template<> +inline XMLOutput& +operator<<(XMLOutput& o, const StartElement& e) +{ + o.se(e.getName()); + return o; +} + +class ICE_UTIL_API EndElement { }; +extern ICE_UTIL_API EndElement ee; + +template<> +inline XMLOutput& +operator<<(XMLOutput& o, const EndElement&) +{ + o.ee(); + return o; +} + +ICE_UTIL_API XMLOutput& operator<<(XMLOutput&, std::ios_base& (*)(std::ios_base&)); + +} + +#endif diff --git a/cpp/include/IceUtil/RWRecMutex.h b/cpp/include/IceUtil/RWRecMutex.h index 00d8a5b5ab8..837bf04853a 100644 --- a/cpp/include/IceUtil/RWRecMutex.h +++ b/cpp/include/IceUtil/RWRecMutex.h @@ -1,256 +1,256 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_RW_REC_MUTEX_H
-#define ICE_UTIL_RW_REC_MUTEX_H
-
-#include <IceUtil/Mutex.h>
-#include <IceUtil/Cond.h>
-#include <IceUtil/Thread.h>
-
-namespace IceUtil
-{
-
-template <typename T>
-class RLock
-{
-public:
-
- RLock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.readlock();
- }
-
- ~RLock()
- {
- _mutex.unlock();
- }
-
- void
- upgrade()
- {
- _mutex.upgrade();
- }
-
- void
- timedUpgrade(const Time& timeout)
- {
- _mutex.timedUpgrade(timeout);
- }
-
-private:
-
- const T& _mutex;
-};
-
-template <typename T>
-class TryRLock
-{
-public:
-
- TryRLock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.tryReadlock();
- }
-
- TryRLock(const T& mutex, const Time& timeout) :
- _mutex(mutex)
- {
- _mutex.timedTryReadlock(timeout);
- }
-
- ~TryRLock()
- {
- _mutex.unlock();
- }
-
- void
- upgrade()
- {
- _mutex.upgrade();
- }
-
- void
- timedUpgrade(const Time& timeout)
- {
- _mutex.timedUpgrade(timeout);
- }
-
-private:
-
- const T& _mutex;
-};
-
-template <typename T>
-class WLock
-{
-public:
-
- WLock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.writelock();
- }
-
- ~WLock()
- {
- _mutex.unlock();
- }
-
-private:
-
- const T& _mutex;
-};
-
-template <typename T>
-class TryWLock
-{
-public:
-
- TryWLock(const T& mutex) :
- _mutex(mutex)
- {
- _mutex.tryWritelock();
- }
-
- TryWLock(const T& mutex, const Time& timeout) :
- _mutex(mutex)
- {
- _mutex.timedTryWritelock(timeout);
- }
-
- ~TryWLock()
- {
- _mutex.unlock();
- }
-
-private:
-
- const T& _mutex;
-};
-
-//
-// Concurrency primitive that allows many readers & one writer access
-// to a data structure. Writers have priority over readers. The
-// structure is not strictly fair in that there is no absolute queue
-// of waiting writers - that is managed by a condition variable.
-//
-// Both Reader & Writer mutexes can be recursively locked. Calling
-// WLock (or TryWLock) while holding a read lock promotes the reader
-// to a writer lock.
-//
-class ICE_UTIL_API RWRecMutex
-{
-public:
-
- //
- // RLock (reader) & WLock (writer) typedefs.
- //
- typedef RLock<RWRecMutex> RLock;
- typedef TryRLock<RWRecMutex> TryRLock;
- typedef WLock<RWRecMutex> WLock;
- typedef TryWLock<RWRecMutex> TryWLock;
-
- RWRecMutex();
- ~RWRecMutex();
-
- //
- // Note that readlock/writelock & unlock in general should not be
- // used directly. Instead use RLock & WLock.
- //
-
- //
- // Acquire a read lock.
- //
- void readlock() const;
-
- //
- // Try to acquire a read lock.
- //
- void tryReadlock() const;
-
- //
- // Try to acquire a read lock for upto the given timeout.
- //
- void timedTryReadlock(const Time&) const;
-
- //
- // Acquire a write lock.
- //
- void writelock() const;
-
- //
- // Acquire a write lock.
- //
- void tryWritelock() const;
-
- //
- // Acquire a write lock for up to the given timeout.
- //
- void timedTryWritelock(const Time&) const;
-
- //
- // Unlock the reader/writer lock.
- //
- void unlock() const;
-
- //
- // Upgrade the read lock to a writer lock. Note that this method
- // can only be called if the reader lock is not held recursively.
- //
- void upgrade() const;
-
- //
- // Upgrade the read lock to a writer lock for up to the given
- // timeout Note that this method can only be called if the reader
- // lock is not held recursively.
- //
- void timedUpgrade(const Time&) const;
-
-private:
-
- // noncopyable
- RWRecMutex(const RWRecMutex&);
- void operator=(const RWRecMutex&);
-
- //
- // Number of readers holding the lock. A positive number indicates
- // readers are active. A negative number means that a writer is
- // active.
- //
- mutable int _count;
-
- //
- // If there is an active writer this is a control for thread.
- //
- mutable ThreadControl _writerControl;
-
- //
- // Number of waiting writers.
- //
- mutable unsigned int _waitingWriters;
-
- //
- // Internal mutex.
- //
- Mutex _mutex;
-
- //
- // Two condition variables for waiting readers & writers.
- //
- mutable Cond _readers;
- mutable Cond _writers;
-};
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_RW_REC_MUTEX_H +#define ICE_UTIL_RW_REC_MUTEX_H + +#include <IceUtil/Mutex.h> +#include <IceUtil/Cond.h> +#include <IceUtil/Thread.h> + +namespace IceUtil +{ + +template <typename T> +class RLock +{ +public: + + RLock(const T& mutex) : + _mutex(mutex) + { + _mutex.readlock(); + } + + ~RLock() + { + _mutex.unlock(); + } + + void + upgrade() + { + _mutex.upgrade(); + } + + void + timedUpgrade(const Time& timeout) + { + _mutex.timedUpgrade(timeout); + } + +private: + + const T& _mutex; +}; + +template <typename T> +class TryRLock +{ +public: + + TryRLock(const T& mutex) : + _mutex(mutex) + { + _mutex.tryReadlock(); + } + + TryRLock(const T& mutex, const Time& timeout) : + _mutex(mutex) + { + _mutex.timedTryReadlock(timeout); + } + + ~TryRLock() + { + _mutex.unlock(); + } + + void + upgrade() + { + _mutex.upgrade(); + } + + void + timedUpgrade(const Time& timeout) + { + _mutex.timedUpgrade(timeout); + } + +private: + + const T& _mutex; +}; + +template <typename T> +class WLock +{ +public: + + WLock(const T& mutex) : + _mutex(mutex) + { + _mutex.writelock(); + } + + ~WLock() + { + _mutex.unlock(); + } + +private: + + const T& _mutex; +}; + +template <typename T> +class TryWLock +{ +public: + + TryWLock(const T& mutex) : + _mutex(mutex) + { + _mutex.tryWritelock(); + } + + TryWLock(const T& mutex, const Time& timeout) : + _mutex(mutex) + { + _mutex.timedTryWritelock(timeout); + } + + ~TryWLock() + { + _mutex.unlock(); + } + +private: + + const T& _mutex; +}; + +// +// Concurrency primitive that allows many readers & one writer access +// to a data structure. Writers have priority over readers. The +// structure is not strictly fair in that there is no absolute queue +// of waiting writers - that is managed by a condition variable. +// +// Both Reader & Writer mutexes can be recursively locked. Calling +// WLock (or TryWLock) while holding a read lock promotes the reader +// to a writer lock. +// +class ICE_UTIL_API RWRecMutex +{ +public: + + // + // RLock (reader) & WLock (writer) typedefs. + // + typedef RLock<RWRecMutex> RLock; + typedef TryRLock<RWRecMutex> TryRLock; + typedef WLock<RWRecMutex> WLock; + typedef TryWLock<RWRecMutex> TryWLock; + + RWRecMutex(); + ~RWRecMutex(); + + // + // Note that readlock/writelock & unlock in general should not be + // used directly. Instead use RLock & WLock. + // + + // + // Acquire a read lock. + // + void readlock() const; + + // + // Try to acquire a read lock. + // + void tryReadlock() const; + + // + // Try to acquire a read lock for upto the given timeout. + // + void timedTryReadlock(const Time&) const; + + // + // Acquire a write lock. + // + void writelock() const; + + // + // Acquire a write lock. + // + void tryWritelock() const; + + // + // Acquire a write lock for up to the given timeout. + // + void timedTryWritelock(const Time&) const; + + // + // Unlock the reader/writer lock. + // + void unlock() const; + + // + // Upgrade the read lock to a writer lock. Note that this method + // can only be called if the reader lock is not held recursively. + // + void upgrade() const; + + // + // Upgrade the read lock to a writer lock for up to the given + // timeout Note that this method can only be called if the reader + // lock is not held recursively. + // + void timedUpgrade(const Time&) const; + +private: + + // noncopyable + RWRecMutex(const RWRecMutex&); + void operator=(const RWRecMutex&); + + // + // Number of readers holding the lock. A positive number indicates + // readers are active. A negative number means that a writer is + // active. + // + mutable int _count; + + // + // If there is an active writer this is a control for thread. + // + mutable ThreadControl _writerControl; + + // + // Number of waiting writers. + // + mutable unsigned int _waitingWriters; + + // + // Internal mutex. + // + Mutex _mutex; + + // + // Two condition variables for waiting readers & writers. + // + mutable Cond _readers; + mutable Cond _writers; +}; + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/RecMutex.h b/cpp/include/IceUtil/RecMutex.h index 7d78de9d404..b5373bbff4f 100644 --- a/cpp/include/IceUtil/RecMutex.h +++ b/cpp/include/IceUtil/RecMutex.h @@ -1,111 +1,111 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_RMUTEX_H
-#define ICE_UTIL_RMUTEX_H
-
-#include <IceUtil/Config.h>
-#include <IceUtil/Lock.h>
-
-namespace IceUtil
-{
-
-//
-// Forward declarations for friend.
-//
-class Cond;
-
-//
-// Recursive Mutex implementation.
-//
-class ICE_UTIL_API RecMutex
-{
-public:
-
- //
- // Lock & TryLock typedefs.
- //
- typedef Lock<RecMutex> Lock;
- typedef TryLock<RecMutex> TryLock;
-
- RecMutex();
- ~RecMutex();
-
- //
- // Note that lock/trylock & unlock in general should not be used
- // directly. Instead use Lock & TryLock.
- //
-
- //
- // The boolean values are for the Monitor implementation which
- // needs to know whether the Mutex has been locked for the first
- // time, or unlocked for the last time (that is another thread is
- // able to acquire the mutex).
- //
-
- //
- // Return true if the mutex has been locked for the first time.
- //
- bool lock() const;
-
- //
- // Throw LockedException in the case that the lock call would
- // block (that is the mutex is already owned by some other
- // thread). Returns true if the mutex has been locked for the
- // first time.
- //
- bool trylock() const;
-
- //
- // Returns true if the mutex has been unlocked for the last time
- // (false otherwise).
- //
- bool unlock() const;
-
-private:
-
- // noncopyable
- RecMutex(const RecMutex&);
- void operator=(const RecMutex&);
-
- //
- // LockState and the lock/unlock variations are for use by the
- // Condition variable implementation.
- //
-#ifdef _WIN32
- struct LockState
- {
- int count;
- };
-#else
- struct LockState
- {
- pthread_mutex_t* mutex;
- int count;
- };
-#endif
-
- void unlock(LockState&) const;
- void lock(LockState&) const;
-
- friend class Cond;
-
-#ifdef _WIN32
- mutable CRITICAL_SECTION _mutex;
-#else
- mutable pthread_mutex_t _mutex;
-#endif
-
- mutable int _count;
-};
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_RMUTEX_H +#define ICE_UTIL_RMUTEX_H + +#include <IceUtil/Config.h> +#include <IceUtil/Lock.h> + +namespace IceUtil +{ + +// +// Forward declarations for friend. +// +class Cond; + +// +// Recursive Mutex implementation. +// +class ICE_UTIL_API RecMutex +{ +public: + + // + // Lock & TryLock typedefs. + // + typedef Lock<RecMutex> Lock; + typedef TryLock<RecMutex> TryLock; + + RecMutex(); + ~RecMutex(); + + // + // Note that lock/trylock & unlock in general should not be used + // directly. Instead use Lock & TryLock. + // + + // + // The boolean values are for the Monitor implementation which + // needs to know whether the Mutex has been locked for the first + // time, or unlocked for the last time (that is another thread is + // able to acquire the mutex). + // + + // + // Return true if the mutex has been locked for the first time. + // + bool lock() const; + + // + // Throw LockedException in the case that the lock call would + // block (that is the mutex is already owned by some other + // thread). Returns true if the mutex has been locked for the + // first time. + // + bool trylock() const; + + // + // Returns true if the mutex has been unlocked for the last time + // (false otherwise). + // + bool unlock() const; + +private: + + // noncopyable + RecMutex(const RecMutex&); + void operator=(const RecMutex&); + + // + // LockState and the lock/unlock variations are for use by the + // Condition variable implementation. + // +#ifdef _WIN32 + struct LockState + { + int count; + }; +#else + struct LockState + { + pthread_mutex_t* mutex; + int count; + }; +#endif + + void unlock(LockState&) const; + void lock(LockState&) const; + + friend class Cond; + +#ifdef _WIN32 + mutable CRITICAL_SECTION _mutex; +#else + mutable pthread_mutex_t _mutex; +#endif + + mutable int _count; +}; + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/Shared.h b/cpp/include/IceUtil/Shared.h index 7ce6427eea6..dfb7e1351e1 100644 --- a/cpp/include/IceUtil/Shared.h +++ b/cpp/include/IceUtil/Shared.h @@ -1,364 +1,364 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_SHARED_H
-#define ICE_UTIL_SHARED_H
-
-#include <IceUtil/Config.h>
-
-//
-// The inline assembler causes problems with shared libraries.
-//
-#if defined(__ICC) && !defined(_WIN32)
-# define ICE_USE_MUTEX_SHARED
-#endif
-
-#ifdef ICE_USE_MUTEX_SHARED
-# include <IceUtil/Mutex.h>
-#endif
-
-#if !defined(_WIN32) && !defined(ICE_USE_MUTEX_SHARED)
-
-//
-// Linux only. Unfortunately, asm/atomic.h builds non-SMP safe code
-// with non-SMP kernels. This means that executables compiled with a
-// non-SMP kernel would fail randomly due to concurrency errors with
-// reference counting on SMP hosts. Therefore the relevent pieces of
-// atomic.h are more-or-less duplicated.
-//
-
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-struct ice_atomic_t
-{
- volatile int counter;
-};
-
-/*
- * ice_atomic_set - set ice_atomic variable
- * @v: pointer of type ice_atomic_t
- * @i: required value
- *
- * Atomically sets the value of @v to @i. Note that the guaranteed
- * useful range of an ice_atomic_t is only 24 bits.
- */
-inline void ice_atomic_set(ice_atomic_t* v, int i)
-{
- v->counter = i;
-}
-
-/*
- * ice_atomic_inc - increment ice_atomic variable
- * @v: pointer of type ice_atomic_t
- *
- * Atomically increments @v by 1. Note that the guaranteed useful
- * range of an ice_atomic_t is only 24 bits.
- *
- * Inlined because this operation is performance critical.
- */
-inline void ice_atomic_inc(ice_atomic_t *v)
-{
- __asm__ __volatile__(
- "lock ; incl %0"
- :"=m" (v->counter)
- :"m" (v->counter));
-}
-
-/**
- * ice_atomic_dec_and_test - decrement and test
- * @v: pointer of type ice_atomic_t
- *
- * Atomically decrements @v by 1 and returns true if the result is 0,
- * or false for all other cases. Note that the guaranteed useful
- * range of an ice_atomic_t is only 24 bits.
- *
- * Inlined because this operation is performance critical.
- */
-inline int ice_atomic_dec_and_test(ice_atomic_t *v)
-{
- unsigned char c;
- __asm__ __volatile__(
- "lock ; decl %0; sete %1"
- :"=m" (v->counter), "=qm" (c)
- :"m" (v->counter) : "memory");
- return c != 0;
-}
-
-/**
- * ice_atomic_exchange_add - same as InterlockedExchangeAdd. This
- * didn't come from atomic.h (the code was derived from similar code
- * in /usr/include/asm/rwsem.h)
- *
- * Inlined because this operation is performance critical.
- */
-inline int ice_atomic_exchange_add(int i, ice_atomic_t* v)
-{
- int tmp = i;
- __asm__ __volatile__(
- "lock ; xadd %0,(%2)"
- :"+r"(tmp), "=m"(v->counter)
- :"r"(v), "m"(v->counter)
- : "memory");
- return tmp + i;
-}
-
-#endif
-
-//
-// Base classes for reference counted types. The IceUtil::Handle
-// template can be used for smart pointers to types derived from these
-// bases.
-//
-// IceUtil::SimpleShared
-// =====================
-//
-// A non thread-safe base class for reference-counted types.
-//
-// IceUtil::Shared
-// ===============
-//
-// A thread-safe base class for reference-counted types.
-//
-namespace IceUtil
-{
-
-//
-// TODO: Not all operations in this class are performance critical,
-// thus not all of them should be inlined.
-//
-
-class SimpleShared : public noncopyable
-{
-public:
-
- SimpleShared() :
- _ref(0),
- _noDelete(false)
- {
- }
-
- virtual ~SimpleShared()
- {
- }
-
- void __incRef()
- {
- assert(_ref >= 0);
- ++_ref;
- }
-
- void __decRef()
- {
- assert(_ref > 0);
- if(--_ref == 0)
- {
- if(!_noDelete)
- {
- delete this;
- }
- }
- }
-
- int __getRef() const
- {
- return _ref;
- }
-
- void __setNoDelete(bool b)
- {
- _noDelete = b;
- }
-
-private:
-
- int _ref;
- bool _noDelete;
-};
-
-class Shared : public noncopyable
-{
-public:
-
- Shared();
- virtual ~Shared();
- void __incRef();
- void __decRef();
- int __getRef() const;
- void __setNoDelete(bool);
-
-private:
-
-#ifdef ICE_USE_MUTEX_SHARED
- int _ref;
- Mutex _mutex;
-#elif defined(_WIN32)
- LONG _ref;
-#else
- ice_atomic_t _ref;
-#endif
- bool _noDelete;
-};
-
-//
-// TODO: Not all operations below are performance critical, thus not
-// all of them should be inlined.
-//
-
-#ifdef ICE_USE_MUTEX_SHARED
-
-inline
-Shared::Shared() :
- _ref(0),
- _noDelete(false)
-{
-}
-
-inline
-Shared::~Shared()
-{
-}
-
-inline void
-Shared::__incRef()
-{
- _mutex.lock();
- assert(_ref >= 0);
- ++_ref;
- _mutex.unlock();
-}
-
-inline void
-Shared::__decRef()
-{
- _mutex.lock();
- bool doDelete = false;
- assert(_ref > 0);
- if(--_ref == 0)
- {
- doDelete = !_noDelete;
- }
- _mutex.unlock();
- if(doDelete)
- {
- delete this;
- }
-}
-
-inline int
-Shared::__getRef() const
-{
- _mutex.lock();
- int ref = _ref;
- _mutex.unlock();
- return ref;
-}
-
-inline void
-Shared::__setNoDelete(bool b)
-{
- _mutex.lock();
- _noDelete = b;
- _mutex.unlock();
-}
-
-#elif defined(_WIN32)
-
-inline
-Shared::Shared() :
- _ref(0),
- _noDelete(false)
-{
-}
-
-inline
-Shared::~Shared()
-{
-}
-
-inline void
-Shared::__incRef()
-{
- assert(InterlockedExchangeAdd(&_ref, 0) >= 0);
- InterlockedIncrement(&_ref);
-}
-
-inline void
-Shared::__decRef()
-{
- assert(InterlockedExchangeAdd(&_ref, 0) > 0);
- if(InterlockedDecrement(&_ref) == 0 && !_noDelete)
- {
- delete this;
- }
-}
-
-inline int
-Shared::__getRef() const
-{
- return InterlockedExchangeAdd(const_cast<LONG*>(&_ref), 0);
-}
-
-inline void
-Shared::__setNoDelete(bool b)
-{
- _noDelete = b;
-}
-
-#else
-
-inline
-Shared::Shared() :
- _noDelete(false)
-{
- ice_atomic_set(&_ref, 0);
-}
-
-inline
-Shared::~Shared()
-{
-}
-
-inline void
-Shared::__incRef()
-{
- assert(ice_atomic_exchange_add(0, &_ref) >= 0);
- ice_atomic_inc(&_ref);
-}
-
-inline void
-Shared::__decRef()
-{
- assert(ice_atomic_exchange_add(0, &_ref) > 0);
- if(ice_atomic_dec_and_test(&_ref) && !_noDelete)
- {
- delete this;
- }
-}
-
-inline int
-Shared::__getRef() const
-{
- return ice_atomic_exchange_add(0, const_cast<ice_atomic_t*>(&_ref));
-}
-
-inline void
-Shared::__setNoDelete(bool b)
-{
- _noDelete = b;
-}
-
-#endif
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_SHARED_H +#define ICE_UTIL_SHARED_H + +#include <IceUtil/Config.h> + +// +// The inline assembler causes problems with shared libraries. +// +#if defined(__ICC) && !defined(_WIN32) +# define ICE_USE_MUTEX_SHARED +#endif + +#ifdef ICE_USE_MUTEX_SHARED +# include <IceUtil/Mutex.h> +#endif + +#if !defined(_WIN32) && !defined(ICE_USE_MUTEX_SHARED) + +// +// Linux only. Unfortunately, asm/atomic.h builds non-SMP safe code +// with non-SMP kernels. This means that executables compiled with a +// non-SMP kernel would fail randomly due to concurrency errors with +// reference counting on SMP hosts. Therefore the relevent pieces of +// atomic.h are more-or-less duplicated. +// + +/* + * Make sure gcc doesn't try to be clever and move things around + * on us. We need to use _exactly_ the address the user gave us, + * not some alias that contains the same information. + */ +struct ice_atomic_t +{ + volatile int counter; +}; + +/* + * ice_atomic_set - set ice_atomic variable + * @v: pointer of type ice_atomic_t + * @i: required value + * + * Atomically sets the value of @v to @i. Note that the guaranteed + * useful range of an ice_atomic_t is only 24 bits. + */ +inline void ice_atomic_set(ice_atomic_t* v, int i) +{ + v->counter = i; +} + +/* + * ice_atomic_inc - increment ice_atomic variable + * @v: pointer of type ice_atomic_t + * + * Atomically increments @v by 1. Note that the guaranteed useful + * range of an ice_atomic_t is only 24 bits. + * + * Inlined because this operation is performance critical. + */ +inline void ice_atomic_inc(ice_atomic_t *v) +{ + __asm__ __volatile__( + "lock ; incl %0" + :"=m" (v->counter) + :"m" (v->counter)); +} + +/** + * ice_atomic_dec_and_test - decrement and test + * @v: pointer of type ice_atomic_t + * + * Atomically decrements @v by 1 and returns true if the result is 0, + * or false for all other cases. Note that the guaranteed useful + * range of an ice_atomic_t is only 24 bits. + * + * Inlined because this operation is performance critical. + */ +inline int ice_atomic_dec_and_test(ice_atomic_t *v) +{ + unsigned char c; + __asm__ __volatile__( + "lock ; decl %0; sete %1" + :"=m" (v->counter), "=qm" (c) + :"m" (v->counter) : "memory"); + return c != 0; +} + +/** + * ice_atomic_exchange_add - same as InterlockedExchangeAdd. This + * didn't come from atomic.h (the code was derived from similar code + * in /usr/include/asm/rwsem.h) + * + * Inlined because this operation is performance critical. + */ +inline int ice_atomic_exchange_add(int i, ice_atomic_t* v) +{ + int tmp = i; + __asm__ __volatile__( + "lock ; xadd %0,(%2)" + :"+r"(tmp), "=m"(v->counter) + :"r"(v), "m"(v->counter) + : "memory"); + return tmp + i; +} + +#endif + +// +// Base classes for reference counted types. The IceUtil::Handle +// template can be used for smart pointers to types derived from these +// bases. +// +// IceUtil::SimpleShared +// ===================== +// +// A non thread-safe base class for reference-counted types. +// +// IceUtil::Shared +// =============== +// +// A thread-safe base class for reference-counted types. +// +namespace IceUtil +{ + +// +// TODO: Not all operations in this class are performance critical, +// thus not all of them should be inlined. +// + +class SimpleShared : public noncopyable +{ +public: + + SimpleShared() : + _ref(0), + _noDelete(false) + { + } + + virtual ~SimpleShared() + { + } + + void __incRef() + { + assert(_ref >= 0); + ++_ref; + } + + void __decRef() + { + assert(_ref > 0); + if(--_ref == 0) + { + if(!_noDelete) + { + delete this; + } + } + } + + int __getRef() const + { + return _ref; + } + + void __setNoDelete(bool b) + { + _noDelete = b; + } + +private: + + int _ref; + bool _noDelete; +}; + +class Shared : public noncopyable +{ +public: + + Shared(); + virtual ~Shared(); + void __incRef(); + void __decRef(); + int __getRef() const; + void __setNoDelete(bool); + +private: + +#ifdef ICE_USE_MUTEX_SHARED + int _ref; + Mutex _mutex; +#elif defined(_WIN32) + LONG _ref; +#else + ice_atomic_t _ref; +#endif + bool _noDelete; +}; + +// +// TODO: Not all operations below are performance critical, thus not +// all of them should be inlined. +// + +#ifdef ICE_USE_MUTEX_SHARED + +inline +Shared::Shared() : + _ref(0), + _noDelete(false) +{ +} + +inline +Shared::~Shared() +{ +} + +inline void +Shared::__incRef() +{ + _mutex.lock(); + assert(_ref >= 0); + ++_ref; + _mutex.unlock(); +} + +inline void +Shared::__decRef() +{ + _mutex.lock(); + bool doDelete = false; + assert(_ref > 0); + if(--_ref == 0) + { + doDelete = !_noDelete; + } + _mutex.unlock(); + if(doDelete) + { + delete this; + } +} + +inline int +Shared::__getRef() const +{ + _mutex.lock(); + int ref = _ref; + _mutex.unlock(); + return ref; +} + +inline void +Shared::__setNoDelete(bool b) +{ + _mutex.lock(); + _noDelete = b; + _mutex.unlock(); +} + +#elif defined(_WIN32) + +inline +Shared::Shared() : + _ref(0), + _noDelete(false) +{ +} + +inline +Shared::~Shared() +{ +} + +inline void +Shared::__incRef() +{ + assert(InterlockedExchangeAdd(&_ref, 0) >= 0); + InterlockedIncrement(&_ref); +} + +inline void +Shared::__decRef() +{ + assert(InterlockedExchangeAdd(&_ref, 0) > 0); + if(InterlockedDecrement(&_ref) == 0 && !_noDelete) + { + delete this; + } +} + +inline int +Shared::__getRef() const +{ + return InterlockedExchangeAdd(const_cast<LONG*>(&_ref), 0); +} + +inline void +Shared::__setNoDelete(bool b) +{ + _noDelete = b; +} + +#else + +inline +Shared::Shared() : + _noDelete(false) +{ + ice_atomic_set(&_ref, 0); +} + +inline +Shared::~Shared() +{ +} + +inline void +Shared::__incRef() +{ + assert(ice_atomic_exchange_add(0, &_ref) >= 0); + ice_atomic_inc(&_ref); +} + +inline void +Shared::__decRef() +{ + assert(ice_atomic_exchange_add(0, &_ref) > 0); + if(ice_atomic_dec_and_test(&_ref) && !_noDelete) + { + delete this; + } +} + +inline int +Shared::__getRef() const +{ + return ice_atomic_exchange_add(0, const_cast<ice_atomic_t*>(&_ref)); +} + +inline void +Shared::__setNoDelete(bool b) +{ + _noDelete = b; +} + +#endif + +} + +#endif diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h index 53af95bf8cc..701cef7b6ab 100644 --- a/cpp/include/IceUtil/Thread.h +++ b/cpp/include/IceUtil/Thread.h @@ -1,117 +1,117 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_THREAD_H
-#define ICE_UTIL_THREAD_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Handle.h>
-
-namespace IceUtil
-{
-
-class Time;
-
-#ifdef _WIN32
-struct HandleWrapper : public Shared
-{
- // Inline for performance reasons.
- HandleWrapper(HANDLE h) :
- handle(h)
- {
- }
-
- // Inline for performance reasons.
- virtual ~HandleWrapper()
- {
- if(handle != 0)
- {
- CloseHandle(handle);
- }
- }
-
- HANDLE handle;
-};
-
-typedef Handle<HandleWrapper> HandleWrapperPtr;
-#endif
-
-class ICE_UTIL_API ThreadControl
-{
-public:
-
- ThreadControl();
-
-#ifdef _WIN32
- ThreadControl(const HandleWrapperPtr&, unsigned);
-#else
- ThreadControl(pthread_t);
-#endif
-
- bool operator==(const ThreadControl&) const;
- bool operator!=(const ThreadControl&) const;
- bool operator<(const ThreadControl&) const;
-
- //
- // Wait until the controlled thread terminates. The call has POSIX
- // semantics.
- //
- // At most one thread can wait for the termination of a given
- // thread.C alling join on a thread on which another thread is
- // already waiting for termination results in undefined behaviour.
- //
- void join();
-
- static void sleep(const Time&);
- static void yield();
-
-private:
-
-#ifdef _WIN32
- HandleWrapperPtr _handle;
- unsigned _id;
-#else
- pthread_t _id;
-#endif
-};
-
-class ICE_UTIL_API Thread : virtual public IceUtil::Shared
-{
-public:
-
- Thread();
- virtual ~Thread();
-
- virtual void run() = 0;
-
- ThreadControl start();
-
- ThreadControl getThreadControl();
-
- bool operator==(const Thread&) const;
- bool operator!=(const Thread&) const;
- bool operator<(const Thread&) const;
-
-private:
-
-#ifdef _WIN32
- unsigned _id;
- HandleWrapperPtr _handle;
-#else
- pthread_t _id;
-#endif
-};
-
-typedef Handle<Thread> ThreadPtr;
-
-} // End namespace IceUtil
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_THREAD_H +#define ICE_UTIL_THREAD_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Handle.h> + +namespace IceUtil +{ + +class Time; + +#ifdef _WIN32 +struct HandleWrapper : public Shared +{ + // Inline for performance reasons. + HandleWrapper(HANDLE h) : + handle(h) + { + } + + // Inline for performance reasons. + virtual ~HandleWrapper() + { + if(handle != 0) + { + CloseHandle(handle); + } + } + + HANDLE handle; +}; + +typedef Handle<HandleWrapper> HandleWrapperPtr; +#endif + +class ICE_UTIL_API ThreadControl +{ +public: + + ThreadControl(); + +#ifdef _WIN32 + ThreadControl(const HandleWrapperPtr&, unsigned); +#else + ThreadControl(pthread_t); +#endif + + bool operator==(const ThreadControl&) const; + bool operator!=(const ThreadControl&) const; + bool operator<(const ThreadControl&) const; + + // + // Wait until the controlled thread terminates. The call has POSIX + // semantics. + // + // At most one thread can wait for the termination of a given + // thread.C alling join on a thread on which another thread is + // already waiting for termination results in undefined behaviour. + // + void join(); + + static void sleep(const Time&); + static void yield(); + +private: + +#ifdef _WIN32 + HandleWrapperPtr _handle; + unsigned _id; +#else + pthread_t _id; +#endif +}; + +class ICE_UTIL_API Thread : virtual public IceUtil::Shared +{ +public: + + Thread(); + virtual ~Thread(); + + virtual void run() = 0; + + ThreadControl start(); + + ThreadControl getThreadControl(); + + bool operator==(const Thread&) const; + bool operator!=(const Thread&) const; + bool operator<(const Thread&) const; + +private: + +#ifdef _WIN32 + unsigned _id; + HandleWrapperPtr _handle; +#else + pthread_t _id; +#endif +}; + +typedef Handle<Thread> ThreadPtr; + +} // End namespace IceUtil + +#endif + diff --git a/cpp/include/IceUtil/Time.h b/cpp/include/IceUtil/Time.h index ef45d9876b7..cd58ecd4ae0 100644 --- a/cpp/include/IceUtil/Time.h +++ b/cpp/include/IceUtil/Time.h @@ -1,69 +1,69 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_TIME_H
-#define ICE_UTIL_TIME_H
-
-#include <IceUtil/Config.h>
-
-namespace IceUtil
-{
-
-class ICE_UTIL_API Time
-{
-public:
-
- Time();
-
- // No copy constructor and assignment operator necessary. The
- // automatically generated copy constructor and assignment
- // operator do the right thing.
-
- static Time now();
- static Time seconds(long);
- static Time milliSeconds(long);
-#ifdef _WIN32
- static Time microSeconds(__int64);
-#else
- static Time microSeconds(long long);
-#endif
-
- Time operator-() const;
- Time operator-(const Time&) const;
- Time operator+(const Time&) const;
- Time& operator+=(const Time&);
- Time& operator-=(const Time&);
-
- bool operator<(const Time&) const;
- bool operator<=(const Time&) const;
- bool operator>(const Time&) const;
- bool operator>=(const Time&) const;
- bool operator==(const Time&) const;
- bool operator!=(const Time&) const;
-
- operator timeval() const;
- operator double() const;
-
-private:
-
-#ifdef _WIN32
-typedef __int64 LongLong;
-#else
-typedef long long LongLong;
-#endif
-
- Time(LongLong);
-
- LongLong _usec;
-};
-
-} // End namespace IceUtil
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_TIME_H +#define ICE_UTIL_TIME_H + +#include <IceUtil/Config.h> + +namespace IceUtil +{ + +class ICE_UTIL_API Time +{ +public: + + Time(); + + // No copy constructor and assignment operator necessary. The + // automatically generated copy constructor and assignment + // operator do the right thing. + + static Time now(); + static Time seconds(long); + static Time milliSeconds(long); +#ifdef _WIN32 + static Time microSeconds(__int64); +#else + static Time microSeconds(long long); +#endif + + Time operator-() const; + Time operator-(const Time&) const; + Time operator+(const Time&) const; + Time& operator+=(const Time&); + Time& operator-=(const Time&); + + bool operator<(const Time&) const; + bool operator<=(const Time&) const; + bool operator>(const Time&) const; + bool operator>=(const Time&) const; + bool operator==(const Time&) const; + bool operator!=(const Time&) const; + + operator timeval() const; + operator double() const; + +private: + +#ifdef _WIN32 +typedef __int64 LongLong; +#else +typedef long long LongLong; +#endif + + Time(LongLong); + + LongLong _usec; +}; + +} // End namespace IceUtil + +#endif diff --git a/cpp/include/IceUtil/UUID.h b/cpp/include/IceUtil/UUID.h index da677c0b388..ba6891f019c 100644 --- a/cpp/include/IceUtil/UUID.h +++ b/cpp/include/IceUtil/UUID.h @@ -1,23 +1,23 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_UUID_H
-#define ICE_UTIL_UUID_H
-
-#include <IceUtil/Config.h>
-
-namespace IceUtil
-{
-
-ICE_UTIL_API std::string generateUUID();
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_UUID_H +#define ICE_UTIL_UUID_H + +#include <IceUtil/Config.h> + +namespace IceUtil +{ + +ICE_UTIL_API std::string generateUUID(); + +} + +#endif diff --git a/cpp/include/IceUtil/Unicode.h b/cpp/include/IceUtil/Unicode.h index 88dda673fe3..a5d5b58514f 100644 --- a/cpp/include/IceUtil/Unicode.h +++ b/cpp/include/IceUtil/Unicode.h @@ -1,24 +1,24 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UTIL_UNICODE_H
-#define ICE_UTIL_UNICODE_H
-
-#include <IceUtil/Config.h>
-
-namespace IceUtil
-{
-
-ICE_UTIL_API std::string wstringToString(const std::wstring&);
-ICE_UTIL_API std::wstring stringToWstring(const std::string&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UTIL_UNICODE_H +#define ICE_UTIL_UNICODE_H + +#include <IceUtil/Config.h> + +namespace IceUtil +{ + +ICE_UTIL_API std::string wstringToString(const std::wstring&); +ICE_UTIL_API std::wstring stringToWstring(const std::string&); + +} + +#endif diff --git a/cpp/include/IceXML/StreamI.h b/cpp/include/IceXML/StreamI.h index 29f54ac8652..57bdf4aebeb 100644 --- a/cpp/include/IceXML/StreamI.h +++ b/cpp/include/IceXML/StreamI.h @@ -1,232 +1,232 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_XML_STREAM_I_H
-#define ICE_XML_STREAM_I_H
-
-#include <Ice/Stream.h>
-#include <Ice/CommunicatorF.h>
-#include <IceUtil/OutputUtil.h>
-
-#include <map>
-
-#ifdef _WIN32
-# ifdef ICE_XML_API_EXPORTS
-# define ICE_XML_API __declspec(dllexport)
-# else
-# define ICE_XML_API __declspec(dllimport)
-# endif
-#else
-# define ICE_XML_API /**/
-#endif
-
-namespace IceXML
-{
-
-//
-// This is to reduce dependencies on Xerces.
-//
-struct StreamInputImpl;
-
-class ICE_XML_API StreamI : public ::Ice::Stream
-{
- StreamI();
- StreamI(const StreamI&);
- void operator=(const StreamI&);
-
-public:
-
- StreamI(const ::Ice::CommunicatorPtr&, std::ostream&);
-
- StreamI(const ::Ice::CommunicatorPtr&, std::istream&, bool = true);
-
- ~StreamI();
-
- virtual void startWriteDictionary(const ::std::string&, ::Ice::Int);
-
- virtual void endWriteDictionary();
-
- virtual void startWriteDictionaryElement();
-
- virtual void endWriteDictionaryElement();
-
- virtual ::Ice::Int startReadDictionary(const ::std::string&);
-
- virtual void endReadDictionary();
-
- virtual void startReadDictionaryElement();
-
- virtual void endReadDictionaryElement();
-
- virtual void startWriteSequence(const ::std::string&, ::Ice::Int);
-
- virtual void endWriteSequence();
-
- virtual void startWriteSequenceElement();
-
- virtual void endWriteSequenceElement();
-
- virtual ::Ice::Int startReadSequence(const ::std::string&);
-
- virtual void endReadSequence();
-
- virtual void startReadSequenceElement();
-
- virtual void endReadSequenceElement();
-
- virtual void startWriteStruct(const ::std::string&);
-
- virtual void endWriteStruct();
-
- virtual void startReadStruct(const ::std::string&);
-
- virtual void endReadStruct();
-
- virtual void startWriteException(const ::std::string&);
-
- virtual void endWriteException();
-
- virtual void startReadException(const ::std::string&);
-
- virtual void endReadException();
-
- virtual void writeEnum(const ::std::string&, const ::Ice::StringSeq&, ::Ice::Int);
-
- virtual ::Ice::Int readEnum(const ::std::string&, const ::Ice::StringSeq&);
-
- virtual void writeByte(const ::std::string&, ::Ice::Byte);
-
- virtual void writeByteSeq(const ::std::string&, const ::Ice::ByteSeq&);
-
- virtual ::Ice::Byte readByte(const ::std::string&);
-
- virtual ::Ice::ByteSeq readByteSeq(const ::std::string&);
-
- virtual void writeBool(const ::std::string&, bool);
-
- virtual void writeBoolSeq(const ::std::string&, const ::Ice::BoolSeq&);
-
- virtual bool readBool(const ::std::string&);
-
- virtual ::Ice::BoolSeq readBoolSeq(const ::std::string&);
-
- virtual void writeShort(const ::std::string&, ::Ice::Short);
-
- virtual void writeShortSeq(const ::std::string&, const ::Ice::ShortSeq&);
-
- virtual ::Ice::Short readShort(const ::std::string&);
-
- virtual ::Ice::ShortSeq readShortSeq(const ::std::string&);
-
- virtual void writeInt(const ::std::string&, ::Ice::Int);
-
- virtual void writeIntSeq(const ::std::string&, const ::Ice::IntSeq&);
-
- virtual ::Ice::Int readInt(const ::std::string&);
-
- virtual ::Ice::IntSeq readIntSeq(const ::std::string&);
-
- virtual void writeLong(const ::std::string&, ::Ice::Long);
-
- virtual void writeLongSeq(const ::std::string&, const ::Ice::LongSeq&);
-
- virtual ::Ice::Long readLong(const ::std::string&);
-
- virtual ::Ice::LongSeq readLongSeq(const ::std::string&);
-
- virtual void writeFloat(const ::std::string&, ::Ice::Float);
-
- virtual void writeFloatSeq(const ::std::string&, const ::Ice::FloatSeq&);
-
- virtual ::Ice::Float readFloat(const ::std::string&);
-
- virtual ::Ice::FloatSeq readFloatSeq(const ::std::string&);
-
- virtual void writeDouble(const ::std::string&, ::Ice::Double);
-
- virtual void writeDoubleSeq(const ::std::string&, const ::Ice::DoubleSeq&);
-
- virtual ::Ice::Double readDouble(const ::std::string&);
-
- virtual ::Ice::DoubleSeq readDoubleSeq(const ::std::string&);
-
- virtual void writeString(const ::std::string&, const ::std::string&);
-
- virtual void writeStringSeq(const ::std::string&, const ::Ice::StringSeq&);
-
- virtual ::std::string readString(const ::std::string&);
-
- virtual ::Ice::StringSeq readStringSeq(const ::std::string&);
-
- virtual void writeProxy(const ::std::string&, const ::Ice::ObjectPrx&);
-
- virtual ::Ice::ObjectPrx readProxy(const ::std::string&);
-
- virtual void writeObject(const ::std::string&, const ::Ice::ObjectPtr&);
-
- virtual ::Ice::ObjectPtr readObject(const ::std::string&, const ::std::string&, const ::Ice::ObjectFactoryPtr&);
-
-private:
-
- void startWrite(const std::string&);
- void endWrite();
-
- void startRead(const std::string&);
- void endRead();
-
- void dumpUnwrittenObjects();
- void writeObjectData(const ::std::string&, const ::std::string&, const ::Ice::ObjectPtr&);
- void readAttributes(::std::string&, ::std::string&, ::std::string&);
- ::Ice::Int readLength();
-
- ::Ice::CommunicatorPtr _communicator;
-
- //
- // Name of the sequence element name
- //
- static const ::std::string seqElementName;
-
- //
- // For reading.
- //
- ::std::string _content;
- StreamInputImpl* _input;
-
- //
- // For writing.
- //
-
- //
- // XML Output stream.
- //
- ::IceUtil::XMLOutput _os;
-
- //
- // Current document level.
- //
- int _level;
-
- //
- // Next id for marshaling objects.
- //
- int _nextId;
- struct ObjectInfo
- {
- ObjectInfo(const ::std::string& i, bool w) :
- id(i), written(w) { }
- ::std::string id; // The id of the associated object
- bool written; // Has the object been written?
- };
- ::std::map<Ice::ObjectPtr, ObjectInfo> _objects;
-};
-
-} // End namespace IceXML
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_XML_STREAM_I_H +#define ICE_XML_STREAM_I_H + +#include <Ice/Stream.h> +#include <Ice/CommunicatorF.h> +#include <IceUtil/OutputUtil.h> + +#include <map> + +#ifdef _WIN32 +# ifdef ICE_XML_API_EXPORTS +# define ICE_XML_API __declspec(dllexport) +# else +# define ICE_XML_API __declspec(dllimport) +# endif +#else +# define ICE_XML_API /**/ +#endif + +namespace IceXML +{ + +// +// This is to reduce dependencies on Xerces. +// +struct StreamInputImpl; + +class ICE_XML_API StreamI : public ::Ice::Stream +{ + StreamI(); + StreamI(const StreamI&); + void operator=(const StreamI&); + +public: + + StreamI(const ::Ice::CommunicatorPtr&, std::ostream&); + + StreamI(const ::Ice::CommunicatorPtr&, std::istream&, bool = true); + + ~StreamI(); + + virtual void startWriteDictionary(const ::std::string&, ::Ice::Int); + + virtual void endWriteDictionary(); + + virtual void startWriteDictionaryElement(); + + virtual void endWriteDictionaryElement(); + + virtual ::Ice::Int startReadDictionary(const ::std::string&); + + virtual void endReadDictionary(); + + virtual void startReadDictionaryElement(); + + virtual void endReadDictionaryElement(); + + virtual void startWriteSequence(const ::std::string&, ::Ice::Int); + + virtual void endWriteSequence(); + + virtual void startWriteSequenceElement(); + + virtual void endWriteSequenceElement(); + + virtual ::Ice::Int startReadSequence(const ::std::string&); + + virtual void endReadSequence(); + + virtual void startReadSequenceElement(); + + virtual void endReadSequenceElement(); + + virtual void startWriteStruct(const ::std::string&); + + virtual void endWriteStruct(); + + virtual void startReadStruct(const ::std::string&); + + virtual void endReadStruct(); + + virtual void startWriteException(const ::std::string&); + + virtual void endWriteException(); + + virtual void startReadException(const ::std::string&); + + virtual void endReadException(); + + virtual void writeEnum(const ::std::string&, const ::Ice::StringSeq&, ::Ice::Int); + + virtual ::Ice::Int readEnum(const ::std::string&, const ::Ice::StringSeq&); + + virtual void writeByte(const ::std::string&, ::Ice::Byte); + + virtual void writeByteSeq(const ::std::string&, const ::Ice::ByteSeq&); + + virtual ::Ice::Byte readByte(const ::std::string&); + + virtual ::Ice::ByteSeq readByteSeq(const ::std::string&); + + virtual void writeBool(const ::std::string&, bool); + + virtual void writeBoolSeq(const ::std::string&, const ::Ice::BoolSeq&); + + virtual bool readBool(const ::std::string&); + + virtual ::Ice::BoolSeq readBoolSeq(const ::std::string&); + + virtual void writeShort(const ::std::string&, ::Ice::Short); + + virtual void writeShortSeq(const ::std::string&, const ::Ice::ShortSeq&); + + virtual ::Ice::Short readShort(const ::std::string&); + + virtual ::Ice::ShortSeq readShortSeq(const ::std::string&); + + virtual void writeInt(const ::std::string&, ::Ice::Int); + + virtual void writeIntSeq(const ::std::string&, const ::Ice::IntSeq&); + + virtual ::Ice::Int readInt(const ::std::string&); + + virtual ::Ice::IntSeq readIntSeq(const ::std::string&); + + virtual void writeLong(const ::std::string&, ::Ice::Long); + + virtual void writeLongSeq(const ::std::string&, const ::Ice::LongSeq&); + + virtual ::Ice::Long readLong(const ::std::string&); + + virtual ::Ice::LongSeq readLongSeq(const ::std::string&); + + virtual void writeFloat(const ::std::string&, ::Ice::Float); + + virtual void writeFloatSeq(const ::std::string&, const ::Ice::FloatSeq&); + + virtual ::Ice::Float readFloat(const ::std::string&); + + virtual ::Ice::FloatSeq readFloatSeq(const ::std::string&); + + virtual void writeDouble(const ::std::string&, ::Ice::Double); + + virtual void writeDoubleSeq(const ::std::string&, const ::Ice::DoubleSeq&); + + virtual ::Ice::Double readDouble(const ::std::string&); + + virtual ::Ice::DoubleSeq readDoubleSeq(const ::std::string&); + + virtual void writeString(const ::std::string&, const ::std::string&); + + virtual void writeStringSeq(const ::std::string&, const ::Ice::StringSeq&); + + virtual ::std::string readString(const ::std::string&); + + virtual ::Ice::StringSeq readStringSeq(const ::std::string&); + + virtual void writeProxy(const ::std::string&, const ::Ice::ObjectPrx&); + + virtual ::Ice::ObjectPrx readProxy(const ::std::string&); + + virtual void writeObject(const ::std::string&, const ::Ice::ObjectPtr&); + + virtual ::Ice::ObjectPtr readObject(const ::std::string&, const ::std::string&, const ::Ice::ObjectFactoryPtr&); + +private: + + void startWrite(const std::string&); + void endWrite(); + + void startRead(const std::string&); + void endRead(); + + void dumpUnwrittenObjects(); + void writeObjectData(const ::std::string&, const ::std::string&, const ::Ice::ObjectPtr&); + void readAttributes(::std::string&, ::std::string&, ::std::string&); + ::Ice::Int readLength(); + + ::Ice::CommunicatorPtr _communicator; + + // + // Name of the sequence element name + // + static const ::std::string seqElementName; + + // + // For reading. + // + ::std::string _content; + StreamInputImpl* _input; + + // + // For writing. + // + + // + // XML Output stream. + // + ::IceUtil::XMLOutput _os; + + // + // Current document level. + // + int _level; + + // + // Next id for marshaling objects. + // + int _nextId; + struct ObjectInfo + { + ObjectInfo(const ::std::string& i, bool w) : + id(i), written(w) { } + ::std::string id; // The id of the associated object + bool written; // Has the object been written? + }; + ::std::map<Ice::ObjectPtr, ObjectInfo> _objects; +}; + +} // End namespace IceXML + +#endif diff --git a/cpp/include/Slice/CPlusPlusUtil.h b/cpp/include/Slice/CPlusPlusUtil.h index fdacc2bf8db..fff635b57a9 100644 --- a/cpp/include/Slice/CPlusPlusUtil.h +++ b/cpp/include/Slice/CPlusPlusUtil.h @@ -1,54 +1,54 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef C_PLUS_PLUS_UTIL_H
-#define C_PLUS_PLUS_UTIL_H
-
-#include <Slice/Parser.h>
-#include <IceUtil/OutputUtil.h>
-
-namespace Slice
-{
-
-struct ToIfdef
-{
- SLICE_API char operator()(char);
-};
-
-SLICE_API std::string changeInclude(const std::string&, const std::vector<std::string>&);
-SLICE_API void printHeader(::IceUtil::Output&);
-SLICE_API void printVersionCheck(::IceUtil::Output&);
-SLICE_API void printDllExportStuff(::IceUtil::Output&, const std::string&);
-
-SLICE_API std::string typeToString(const TypePtr&);
-SLICE_API std::string returnTypeToString(const TypePtr&);
-SLICE_API std::string inputTypeToString(const TypePtr&);
-SLICE_API std::string outputTypeToString(const TypePtr&);
-
-SLICE_API void writeMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool,
- const std::string& = "", bool = true);
-SLICE_API void writeMarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&,
- const TypePtr&);
-SLICE_API void writeUnmarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&,
- const TypePtr&);
-SLICE_API void writeAllocateCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&,
- const TypePtr&);
-
-SLICE_API void writeGenericMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool,
- const std::string& = "", const std::string& = "", bool = true);
-
-SLICE_API void writeGenericMarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&,
- const TypePtr&);
-SLICE_API void writeGenericUnmarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&,
- const TypePtr&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef C_PLUS_PLUS_UTIL_H +#define C_PLUS_PLUS_UTIL_H + +#include <Slice/Parser.h> +#include <IceUtil/OutputUtil.h> + +namespace Slice +{ + +struct ToIfdef +{ + SLICE_API char operator()(char); +}; + +SLICE_API std::string changeInclude(const std::string&, const std::vector<std::string>&); +SLICE_API void printHeader(::IceUtil::Output&); +SLICE_API void printVersionCheck(::IceUtil::Output&); +SLICE_API void printDllExportStuff(::IceUtil::Output&, const std::string&); + +SLICE_API std::string typeToString(const TypePtr&); +SLICE_API std::string returnTypeToString(const TypePtr&); +SLICE_API std::string inputTypeToString(const TypePtr&); +SLICE_API std::string outputTypeToString(const TypePtr&); + +SLICE_API void writeMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool, + const std::string& = "", bool = true); +SLICE_API void writeMarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); +SLICE_API void writeUnmarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); +SLICE_API void writeAllocateCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); + +SLICE_API void writeGenericMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool, + const std::string& = "", const std::string& = "", bool = true); + +SLICE_API void writeGenericMarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); +SLICE_API void writeGenericUnmarshalCode(::IceUtil::Output&, const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); + +} + +#endif diff --git a/cpp/include/Slice/JavaUtil.h b/cpp/include/Slice/JavaUtil.h index c35be0909be..fb7a56c2ed1 100644 --- a/cpp/include/Slice/JavaUtil.h +++ b/cpp/include/Slice/JavaUtil.h @@ -1,112 +1,112 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef JAVA_UTIL_H
-#define JAVA_UTIL_H
-
-#include <Slice/Parser.h>
-#include <IceUtil/OutputUtil.h>
-
-namespace Slice
-{
-
-class SLICE_API JavaGenerator : public ::IceUtil::noncopyable
-{
-public:
-
- virtual ~JavaGenerator();
-
-protected:
-
- JavaGenerator(const std::string&, const std::string&);
-
- //
- // Given the fully-scoped Java class name, create any intermediate
- // package directories and open the class file
- //
- bool open(const std::string&);
- void close();
-
- ::IceUtil::Output& output() const;
-
- //
- // Check a symbol against any of the Java keywords. If a
- // match is found, return the symbol with a leading underscore.
- //
- std::string fixKwd(const std::string&) const;
-
- //
- // Convert a scoped name into a Java class name. If an optional
- // scope is provided, the scope will be removed from the result.
- //
- std::string getAbsolute(const std::string&,
- const std::string& = std::string(),
- const std::string& = std::string(),
- const std::string& = std::string()) const;
-
- //
- // Get the Java name for a type. If an optional scope is provided,
- // the scope will be removed from the result if possible.
- //
- enum TypeMode
- {
- TypeModeIn,
- TypeModeOut,
- TypeModeMember,
- TypeModeReturn
- };
- std::string typeToString(const TypePtr&, TypeMode mode,
- const std::string& = std::string(),
- const std::list<std::string>& = std::list<std::string>()) const;
-
- //
- // Generate code to marshal or unmarshal a type
- //
- void writeMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const TypePtr&, const std::string&,
- bool, int&, bool = false, const std::list<std::string>& = std::list<std::string>());
-
- //
- // Generate code to marshal or unmarshal a sequence type
- //
- void writeSequenceMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const SequencePtr&,
- const std::string&, bool, int&, bool,
- const std::list<std::string>& = std::list<std::string>());
-
- //
- // Generate generic code to marshal or unmarshal a type
- //
- void writeGenericMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const TypePtr&,
- const std::string&, const std::string&, bool, int&, bool = false,
- const std::list<std::string>& = std::list<std::string>());
-
- //
- // Generate generic code to marshal or unmarshal a sequence type
- //
- void writeGenericSequenceMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const SequencePtr&,
- const std::string&, const std::string&, bool, int&, bool,
- const std::list<std::string>& = std::list<std::string>());
-
-protected:
-
- static std::string findMetaData(const std::list<std::string>&);
-
-private:
-
- void printHeader();
-
- std::string _dir;
- std::string _package;
-
- ::IceUtil::Output* _out;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef JAVA_UTIL_H +#define JAVA_UTIL_H + +#include <Slice/Parser.h> +#include <IceUtil/OutputUtil.h> + +namespace Slice +{ + +class SLICE_API JavaGenerator : public ::IceUtil::noncopyable +{ +public: + + virtual ~JavaGenerator(); + +protected: + + JavaGenerator(const std::string&, const std::string&); + + // + // Given the fully-scoped Java class name, create any intermediate + // package directories and open the class file + // + bool open(const std::string&); + void close(); + + ::IceUtil::Output& output() const; + + // + // Check a symbol against any of the Java keywords. If a + // match is found, return the symbol with a leading underscore. + // + std::string fixKwd(const std::string&) const; + + // + // Convert a scoped name into a Java class name. If an optional + // scope is provided, the scope will be removed from the result. + // + std::string getAbsolute(const std::string&, + const std::string& = std::string(), + const std::string& = std::string(), + const std::string& = std::string()) const; + + // + // Get the Java name for a type. If an optional scope is provided, + // the scope will be removed from the result if possible. + // + enum TypeMode + { + TypeModeIn, + TypeModeOut, + TypeModeMember, + TypeModeReturn + }; + std::string typeToString(const TypePtr&, TypeMode mode, + const std::string& = std::string(), + const std::list<std::string>& = std::list<std::string>()) const; + + // + // Generate code to marshal or unmarshal a type + // + void writeMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const TypePtr&, const std::string&, + bool, int&, bool = false, const std::list<std::string>& = std::list<std::string>()); + + // + // Generate code to marshal or unmarshal a sequence type + // + void writeSequenceMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const SequencePtr&, + const std::string&, bool, int&, bool, + const std::list<std::string>& = std::list<std::string>()); + + // + // Generate generic code to marshal or unmarshal a type + // + void writeGenericMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const TypePtr&, + const std::string&, const std::string&, bool, int&, bool = false, + const std::list<std::string>& = std::list<std::string>()); + + // + // Generate generic code to marshal or unmarshal a sequence type + // + void writeGenericSequenceMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const SequencePtr&, + const std::string&, const std::string&, bool, int&, bool, + const std::list<std::string>& = std::list<std::string>()); + +protected: + + static std::string findMetaData(const std::list<std::string>&); + +private: + + void printHeader(); + + std::string _dir; + std::string _package; + + ::IceUtil::Output* _out; +}; + +} + +#endif diff --git a/cpp/src/Freeze/DBI.h b/cpp/src/Freeze/DBI.h index 7014a7f623a..448a7dfa680 100644 --- a/cpp/src/Freeze/DBI.h +++ b/cpp/src/Freeze/DBI.h @@ -1,157 +1,157 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_DB_I_H
-#define FREEZE_DB_I_H
-
-#include <IceUtil/IceUtil.h>
-#include <Ice/Ice.h>
-#include <Freeze/DB.h>
-#include <db.h>
-
-namespace Freeze
-{
-
-//
-// Check a Berkeley DB return result, and throw an apropriate
-// exception.
-//
-void checkBerkeleyDBReturn(int ret, const std::string&, const std::string&);
-
-class DBEnvironmentI;
-typedef IceUtil::Handle<DBEnvironmentI> DBEnvironmentIPtr;
-
-class DBEnvironmentI : public DBEnvironment, public IceUtil::RecMutex
-{
-public:
-
- DBEnvironmentI(const ::Ice::CommunicatorPtr&, const std::string&);
- virtual ~DBEnvironmentI();
-
- virtual std::string getName();
- virtual ::Ice::CommunicatorPtr getCommunicator();
-
- virtual DBPtr openDB(const std::string&, bool);
-
- virtual DBTransactionPtr startTransaction();
-
- virtual void close();
-
-private:
-
- // DBI needs access to add, remove & eraseDB
- friend class DBI;
- void add(const std::string&, const DBPtr&);
- void remove(const std::string&);
- void eraseDB(const std::string&);
-
- ::Ice::CommunicatorPtr _communicator;
- int _trace;
-
- ::DB_ENV* _dbEnv;
-
- std::string _name;
- std::string _errorPrefix;
-
- std::map<std::string, DBPtr> _dbMap;
-};
-
-class DBTransactionI : public DBTransaction, public IceUtil::Mutex
-{
-public:
-
- DBTransactionI(const ::Ice::CommunicatorPtr&, ::DB_ENV*, const std::string&);
- virtual ~DBTransactionI();
-
- virtual void commit();
- virtual void abort();
-
-private:
-
- ::Ice::CommunicatorPtr _communicator;
- int _trace;
-
- ::DB_TXN* _tid;
-
- std::string _name;
- std::string _errorPrefix;
-};
-
-class DBCursorI : public DBCursor, public IceUtil::Mutex
-{
-public:
-
- DBCursorI(const ::Ice::CommunicatorPtr&, const std::string&, DBC*);
- ~DBCursorI();
-
- virtual ::Ice::CommunicatorPtr getCommunicator();
-
- virtual void curr(Key& key, Value& value);
- virtual void set(const Value& value);
- virtual bool next();
- virtual bool prev();
- virtual void del();
-
- virtual DBCursorPtr clone();
- virtual void close();
-
-private:
-
- ::Ice::CommunicatorPtr _communicator;
- int _trace;
-
- std::string _name;
- std::string _errorPrefix;
-
- DBC* _cursor;
-};
-
-class DBI : public DB, public IceUtil::Mutex
-{
-public:
-
- DBI(const ::Ice::CommunicatorPtr&, const DBEnvironmentIPtr&, ::DB*, const std::string&, bool);
- virtual ~DBI();
-
- virtual std::string getName();
- virtual ::Ice::CommunicatorPtr getCommunicator();
-
- virtual ::Ice::Long getNumberOfRecords();
-
- virtual DBCursorPtr getCursor();
- virtual DBCursorPtr getCursorAtKey(const Key&);
-
- virtual void put(const Key&, const Value&);
- virtual bool contains(const Key&);
- virtual Value get(const Key&);
- virtual void del(const Key&);
-
- virtual void clear();
-
- virtual void close();
- virtual void remove();
-
- virtual EvictorPtr createEvictor(EvictorPersistenceMode);
-
-private:
-
- ::Ice::CommunicatorPtr _communicator;
- int _trace;
-
- DBEnvironmentIPtr _dbEnvObj;
- ::DB* _db;
-
- std::string _name;
- std::string _errorPrefix;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_DB_I_H +#define FREEZE_DB_I_H + +#include <IceUtil/IceUtil.h> +#include <Ice/Ice.h> +#include <Freeze/DB.h> +#include <db.h> + +namespace Freeze +{ + +// +// Check a Berkeley DB return result, and throw an apropriate +// exception. +// +void checkBerkeleyDBReturn(int ret, const std::string&, const std::string&); + +class DBEnvironmentI; +typedef IceUtil::Handle<DBEnvironmentI> DBEnvironmentIPtr; + +class DBEnvironmentI : public DBEnvironment, public IceUtil::RecMutex +{ +public: + + DBEnvironmentI(const ::Ice::CommunicatorPtr&, const std::string&); + virtual ~DBEnvironmentI(); + + virtual std::string getName(); + virtual ::Ice::CommunicatorPtr getCommunicator(); + + virtual DBPtr openDB(const std::string&, bool); + + virtual DBTransactionPtr startTransaction(); + + virtual void close(); + +private: + + // DBI needs access to add, remove & eraseDB + friend class DBI; + void add(const std::string&, const DBPtr&); + void remove(const std::string&); + void eraseDB(const std::string&); + + ::Ice::CommunicatorPtr _communicator; + int _trace; + + ::DB_ENV* _dbEnv; + + std::string _name; + std::string _errorPrefix; + + std::map<std::string, DBPtr> _dbMap; +}; + +class DBTransactionI : public DBTransaction, public IceUtil::Mutex +{ +public: + + DBTransactionI(const ::Ice::CommunicatorPtr&, ::DB_ENV*, const std::string&); + virtual ~DBTransactionI(); + + virtual void commit(); + virtual void abort(); + +private: + + ::Ice::CommunicatorPtr _communicator; + int _trace; + + ::DB_TXN* _tid; + + std::string _name; + std::string _errorPrefix; +}; + +class DBCursorI : public DBCursor, public IceUtil::Mutex +{ +public: + + DBCursorI(const ::Ice::CommunicatorPtr&, const std::string&, DBC*); + ~DBCursorI(); + + virtual ::Ice::CommunicatorPtr getCommunicator(); + + virtual void curr(Key& key, Value& value); + virtual void set(const Value& value); + virtual bool next(); + virtual bool prev(); + virtual void del(); + + virtual DBCursorPtr clone(); + virtual void close(); + +private: + + ::Ice::CommunicatorPtr _communicator; + int _trace; + + std::string _name; + std::string _errorPrefix; + + DBC* _cursor; +}; + +class DBI : public DB, public IceUtil::Mutex +{ +public: + + DBI(const ::Ice::CommunicatorPtr&, const DBEnvironmentIPtr&, ::DB*, const std::string&, bool); + virtual ~DBI(); + + virtual std::string getName(); + virtual ::Ice::CommunicatorPtr getCommunicator(); + + virtual ::Ice::Long getNumberOfRecords(); + + virtual DBCursorPtr getCursor(); + virtual DBCursorPtr getCursorAtKey(const Key&); + + virtual void put(const Key&, const Value&); + virtual bool contains(const Key&); + virtual Value get(const Key&); + virtual void del(const Key&); + + virtual void clear(); + + virtual void close(); + virtual void remove(); + + virtual EvictorPtr createEvictor(EvictorPersistenceMode); + +private: + + ::Ice::CommunicatorPtr _communicator; + int _trace; + + DBEnvironmentIPtr _dbEnvObj; + ::DB* _db; + + std::string _name; + std::string _errorPrefix; +}; + +} + +#endif diff --git a/cpp/src/Freeze/EvictorI.h b/cpp/src/Freeze/EvictorI.h index f113579dad5..5c7a7304b2f 100644 --- a/cpp/src/Freeze/EvictorI.h +++ b/cpp/src/Freeze/EvictorI.h @@ -1,76 +1,76 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FREEZE_EVICTOR_I_H
-#define FREEZE_EVICTOR_I_H
-
-#include <IceUtil/IceUtil.h>
-#include <Ice/Ice.h>
-#include <Freeze/Evictor.h>
-#include <Freeze/IdentityObjectDict.h>
-
-#include <list>
-
-namespace Freeze
-{
-
-class EvictorI : public Evictor, public IceUtil::Mutex
-{
-public:
-
- EvictorI(const Freeze::DBPtr&, EvictorPersistenceMode);
- virtual ~EvictorI();
-
- virtual DBPtr getDB();
-
- virtual void setSize(Ice::Int);
- virtual Ice::Int getSize();
-
- virtual void createObject(const Ice::Identity&, const Ice::ObjectPtr&);
- virtual void destroyObject(const Ice::Identity&);
-
- virtual void installServantInitializer(const ServantInitializerPtr&);
- virtual EvictorIteratorPtr getIterator();
- virtual bool hasObject(const Ice::Identity&);
-
- virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&);
- virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&,
- const Ice::ObjectPtr&, const Ice::LocalObjectPtr&);
- virtual void deactivate();
-
-private:
-
- struct EvictorElement : public Ice::LocalObject
- {
- Ice::ObjectPtr servant;
- std::list<Ice::Identity>::iterator position;
- int usageCount;
- };
- typedef IceUtil::Handle<EvictorElement> EvictorElementPtr;
-
- void evict();
- EvictorElementPtr add(const Ice::Identity&, const Ice::ObjectPtr&);
- void remove(const Ice::Identity&);
-
- std::map<Ice::Identity, EvictorElementPtr> _evictorMap;
- std::list<Ice::Identity> _evictorList;
- std::map<Ice::Identity, EvictorElementPtr>::size_type _evictorSize;
-
- bool _deactivated;
- IdentityObjectDict _dict;
- Freeze::DBPtr _db;
- EvictorPersistenceMode _persistenceMode;
- ServantInitializerPtr _initializer;
- int _trace;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FREEZE_EVICTOR_I_H +#define FREEZE_EVICTOR_I_H + +#include <IceUtil/IceUtil.h> +#include <Ice/Ice.h> +#include <Freeze/Evictor.h> +#include <Freeze/IdentityObjectDict.h> + +#include <list> + +namespace Freeze +{ + +class EvictorI : public Evictor, public IceUtil::Mutex +{ +public: + + EvictorI(const Freeze::DBPtr&, EvictorPersistenceMode); + virtual ~EvictorI(); + + virtual DBPtr getDB(); + + virtual void setSize(Ice::Int); + virtual Ice::Int getSize(); + + virtual void createObject(const Ice::Identity&, const Ice::ObjectPtr&); + virtual void destroyObject(const Ice::Identity&); + + virtual void installServantInitializer(const ServantInitializerPtr&); + virtual EvictorIteratorPtr getIterator(); + virtual bool hasObject(const Ice::Identity&); + + virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&); + virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&, + const Ice::ObjectPtr&, const Ice::LocalObjectPtr&); + virtual void deactivate(); + +private: + + struct EvictorElement : public Ice::LocalObject + { + Ice::ObjectPtr servant; + std::list<Ice::Identity>::iterator position; + int usageCount; + }; + typedef IceUtil::Handle<EvictorElement> EvictorElementPtr; + + void evict(); + EvictorElementPtr add(const Ice::Identity&, const Ice::ObjectPtr&); + void remove(const Ice::Identity&); + + std::map<Ice::Identity, EvictorElementPtr> _evictorMap; + std::list<Ice::Identity> _evictorList; + std::map<Ice::Identity, EvictorElementPtr>::size_type _evictorSize; + + bool _deactivated; + IdentityObjectDict _dict; + Freeze::DBPtr _db; + EvictorPersistenceMode _persistenceMode; + ServantInitializerPtr _initializer; + int _trace; +}; + +} + +#endif diff --git a/cpp/src/Glacier/Blobject.h b/cpp/src/Glacier/Blobject.h index ae550769290..3c362e771c0 100644 --- a/cpp/src/Glacier/Blobject.h +++ b/cpp/src/Glacier/Blobject.h @@ -1,53 +1,53 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef BLOBJECT_H
-#define BLOBJECT_H
-
-#include <Ice/Ice.h>
-#include <Glacier/Missive.h>
-
-namespace Glacier
-{
-
-class Blobject : public Ice::Blobject
-{
-public:
-
- Blobject(const Ice::CommunicatorPtr&);
- virtual ~Blobject();
-
- virtual bool reverse() = 0;
-
- void destroy();
- bool invoke(Ice::ObjectPrx&, const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
- MissiveQueuePtr modifyProxy(Ice::ObjectPrx&, const Ice::Current&);
-
-protected:
-
- Ice::CommunicatorPtr _communicator;
- Ice::LoggerPtr _logger;
-
- int _traceLevel;
- bool _forwardContext;
- IceUtil::Time _batchSleepTime;
-
-private:
-
- MissiveQueuePtr getMissiveQueue();
-
- MissiveQueuePtr _missiveQueue;
- IceUtil::ThreadControl _missiveQueueControl;
- IceUtil::Mutex _missiveQueueMutex;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef BLOBJECT_H +#define BLOBJECT_H + +#include <Ice/Ice.h> +#include <Glacier/Missive.h> + +namespace Glacier +{ + +class Blobject : public Ice::Blobject +{ +public: + + Blobject(const Ice::CommunicatorPtr&); + virtual ~Blobject(); + + virtual bool reverse() = 0; + + void destroy(); + bool invoke(Ice::ObjectPrx&, const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&); + MissiveQueuePtr modifyProxy(Ice::ObjectPrx&, const Ice::Current&); + +protected: + + Ice::CommunicatorPtr _communicator; + Ice::LoggerPtr _logger; + + int _traceLevel; + bool _forwardContext; + IceUtil::Time _batchSleepTime; + +private: + + MissiveQueuePtr getMissiveQueue(); + + MissiveQueuePtr _missiveQueue; + IceUtil::ThreadControl _missiveQueueControl; + IceUtil::Mutex _missiveQueueMutex; +}; + +} + +#endif diff --git a/cpp/src/Glacier/ClientBlobject.h b/cpp/src/Glacier/ClientBlobject.h index 77d68adf86a..cb866f6a4ac 100644 --- a/cpp/src/Glacier/ClientBlobject.h +++ b/cpp/src/Glacier/ClientBlobject.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CLIENT_BLOBJECT_H
-#define CLIENT_BLOBJECT_H
-
-#include <Ice/RoutingTableF.h>
-#include <Glacier/Blobject.h>
-
-namespace Glacier
-{
-
-class ClientBlobject : public Glacier::Blobject
-{
-public:
-
- ClientBlobject(const Ice::CommunicatorPtr&, const IceInternal::RoutingTablePtr&, const std::string&);
-
- virtual bool reverse();
-
- void destroy();
- virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
-
-private:
-
- IceInternal::RoutingTablePtr _routingTable;
- std::vector<std::string> _allowCategories;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CLIENT_BLOBJECT_H +#define CLIENT_BLOBJECT_H + +#include <Ice/RoutingTableF.h> +#include <Glacier/Blobject.h> + +namespace Glacier +{ + +class ClientBlobject : public Glacier::Blobject +{ +public: + + ClientBlobject(const Ice::CommunicatorPtr&, const IceInternal::RoutingTablePtr&, const std::string&); + + virtual bool reverse(); + + void destroy(); + virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&); + +private: + + IceInternal::RoutingTablePtr _routingTable; + std::vector<std::string> _allowCategories; +}; + +} + +#endif diff --git a/cpp/src/Glacier/Missive.h b/cpp/src/Glacier/Missive.h index 534dee19f4f..96ec51c5762 100644 --- a/cpp/src/Glacier/Missive.h +++ b/cpp/src/Glacier/Missive.h @@ -1,74 +1,74 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef MISSIVE_H
-#define MISSIVE_H
-
-#include <Ice/Ice.h>
-#include <IceUtil/Thread.h>
-#include <IceUtil/Monitor.h>
-
-namespace Glacier
-{
-
-class Missive;
-typedef IceUtil::Handle<Missive> MissivePtr;
-
-class Missive : virtual public IceUtil::Shared
-{
-public:
-
- Missive(const Ice::ObjectPrx&, const std::vector<Ice::Byte>&, const Ice::Current&, bool);
-
- void invoke();
- bool override(const MissivePtr&);
- const Ice::ObjectPrx& getProxy() const;
- const Ice::Current& getCurrent() const;
-
-private:
-
- Ice::ObjectPrx _proxy;
- std::vector<Ice::Byte> _inParams;
- Ice::Current _current;
- bool _forwardContext;
- std::string _override;
-};
-
-class MissiveQueue;
-typedef IceUtil::Handle<MissiveQueue> MissiveQueuePtr;
-
-class MissiveQueue : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex>
-{
-public:
-
- MissiveQueue(const Ice::CommunicatorPtr&, int, bool, const IceUtil::Time&);
- virtual ~MissiveQueue();
-
- void destroy();
- void add(const MissivePtr&);
-
- virtual void run();
-
-private:
-
- Ice::CommunicatorPtr _communicator;
- Ice::LoggerPtr _logger;
- int _traceLevel;
- bool _reverse;
- IceUtil::Time _sleepTime;
-
- std::vector<MissivePtr> _missives;
- bool _destroy;
-};
-
-};
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef MISSIVE_H +#define MISSIVE_H + +#include <Ice/Ice.h> +#include <IceUtil/Thread.h> +#include <IceUtil/Monitor.h> + +namespace Glacier +{ + +class Missive; +typedef IceUtil::Handle<Missive> MissivePtr; + +class Missive : virtual public IceUtil::Shared +{ +public: + + Missive(const Ice::ObjectPrx&, const std::vector<Ice::Byte>&, const Ice::Current&, bool); + + void invoke(); + bool override(const MissivePtr&); + const Ice::ObjectPrx& getProxy() const; + const Ice::Current& getCurrent() const; + +private: + + Ice::ObjectPrx _proxy; + std::vector<Ice::Byte> _inParams; + Ice::Current _current; + bool _forwardContext; + std::string _override; +}; + +class MissiveQueue; +typedef IceUtil::Handle<MissiveQueue> MissiveQueuePtr; + +class MissiveQueue : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + MissiveQueue(const Ice::CommunicatorPtr&, int, bool, const IceUtil::Time&); + virtual ~MissiveQueue(); + + void destroy(); + void add(const MissivePtr&); + + virtual void run(); + +private: + + Ice::CommunicatorPtr _communicator; + Ice::LoggerPtr _logger; + int _traceLevel; + bool _reverse; + IceUtil::Time _sleepTime; + + std::vector<MissivePtr> _missives; + bool _destroy; +}; + +}; + +#endif + diff --git a/cpp/src/Glacier/RouterI.h b/cpp/src/Glacier/RouterI.h index 8dc57381f4a..03a3aaee906 100644 --- a/cpp/src/Glacier/RouterI.h +++ b/cpp/src/Glacier/RouterI.h @@ -1,55 +1,55 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GLACIER_ROUTER_I_H
-#define GLACIER_ROUTER_I_H
-
-#include <Ice/RoutingTableF.h>
-#include <Ice/Ice.h>
-#include <Glacier/Router.h>
-#include <Glacier/SessionManagerF.h>
-
-namespace Glacier
-{
-
-class RouterI : public Router
-{
-public:
-
- RouterI(const Ice::ObjectAdapterPtr&, const Ice::ObjectAdapterPtr&, const ::IceInternal::RoutingTablePtr&,
- const SessionManagerPrx&, const std::string&);
-
- virtual ~RouterI();
-
- void destroy();
-
- virtual Ice::ObjectPrx getClientProxy(const Ice::Current&);
- virtual Ice::ObjectPrx getServerProxy(const Ice::Current&);
- virtual void addProxy(const Ice::ObjectPrx&, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
- virtual SessionPrx createSession(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _clientAdapter;
- Ice::ObjectAdapterPtr _serverAdapter;
- Ice::LoggerPtr _logger;
- ::IceInternal::RoutingTablePtr _routingTable;
- int _routingTableTraceLevel;
-
- IceUtil::Mutex _sessionMutex;
- SessionManagerPrx _sessionManager;
- std::vector<SessionPrx> _sessions;
- std::string _userId;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GLACIER_ROUTER_I_H +#define GLACIER_ROUTER_I_H + +#include <Ice/RoutingTableF.h> +#include <Ice/Ice.h> +#include <Glacier/Router.h> +#include <Glacier/SessionManagerF.h> + +namespace Glacier +{ + +class RouterI : public Router +{ +public: + + RouterI(const Ice::ObjectAdapterPtr&, const Ice::ObjectAdapterPtr&, const ::IceInternal::RoutingTablePtr&, + const SessionManagerPrx&, const std::string&); + + virtual ~RouterI(); + + void destroy(); + + virtual Ice::ObjectPrx getClientProxy(const Ice::Current&); + virtual Ice::ObjectPrx getServerProxy(const Ice::Current&); + virtual void addProxy(const Ice::ObjectPrx&, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + virtual SessionPrx createSession(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _clientAdapter; + Ice::ObjectAdapterPtr _serverAdapter; + Ice::LoggerPtr _logger; + ::IceInternal::RoutingTablePtr _routingTable; + int _routingTableTraceLevel; + + IceUtil::Mutex _sessionMutex; + SessionManagerPrx _sessionManager; + std::vector<SessionPrx> _sessions; + std::string _userId; +}; + +} + +#endif diff --git a/cpp/src/Glacier/ServerBlobject.h b/cpp/src/Glacier/ServerBlobject.h index 41d71726547..d28ac9e9515 100644 --- a/cpp/src/Glacier/ServerBlobject.h +++ b/cpp/src/Glacier/ServerBlobject.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SERVER_BLOBJECT_H
-#define SERVER_BLOBJECT_H
-
-#include <Glacier/Blobject.h>
-
-namespace Glacier
-{
-
-class ServerBlobject : public Glacier::Blobject
-{
-public:
-
- ServerBlobject(const Ice::ObjectAdapterPtr&);
-
- virtual bool reverse();
-
- void destroy();
- virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _clientAdapter;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SERVER_BLOBJECT_H +#define SERVER_BLOBJECT_H + +#include <Glacier/Blobject.h> + +namespace Glacier +{ + +class ServerBlobject : public Glacier::Blobject +{ +public: + + ServerBlobject(const Ice::ObjectAdapterPtr&); + + virtual bool reverse(); + + void destroy(); + virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _clientAdapter; +}; + +} + +#endif diff --git a/cpp/src/Glacier/StarterI.h b/cpp/src/Glacier/StarterI.h index 1642d911604..41ba2958f2a 100644 --- a/cpp/src/Glacier/StarterI.h +++ b/cpp/src/Glacier/StarterI.h @@ -1,66 +1,66 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GLACIER_GLACIER_I_H
-#define GLACIER_GLACIER_I_H
-
-#include <Ice/Ice.h>
-#include <IceSSL/RSACertificateGen.h>
-#include <Glacier/Starter.h>
-
-namespace Glacier
-{
-
-using IceSSL::OpenSSL::RSACertificateGenContext;
-using IceSSL::OpenSSL::RSACertificateGen;
-
-class StarterI : public Starter
-{
-public:
-
- StarterI(const Ice::CommunicatorPtr&, const PasswordVerifierPrx&);
-
- void destroy();
-
- RouterPrx startRouter(const std::string&,
- const std::string&,
- Ice::ByteSeq&,
- Ice::ByteSeq&,
- Ice::ByteSeq&,
- const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
- Ice::LoggerPtr _logger;
- Ice::PropertiesPtr _properties;
- PasswordVerifierPrx _verifier;
- int _traceLevel;
- RSACertificateGenContext _certContext;
- RSACertificateGen _certificateGenerator;
-};
-
-class CryptPasswordVerifierI : public PasswordVerifier, public IceUtil::Mutex
-{
-public:
-
- CryptPasswordVerifierI(const std::map<std::string, std::string>&);
-
- virtual bool checkPassword(const std::string&, const std::string&, const Ice::Current&);
- virtual void destroy(const Ice::Current&);
-
-private:
-
- const std::map<std::string, std::string> _passwords;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GLACIER_GLACIER_I_H +#define GLACIER_GLACIER_I_H + +#include <Ice/Ice.h> +#include <IceSSL/RSACertificateGen.h> +#include <Glacier/Starter.h> + +namespace Glacier +{ + +using IceSSL::OpenSSL::RSACertificateGenContext; +using IceSSL::OpenSSL::RSACertificateGen; + +class StarterI : public Starter +{ +public: + + StarterI(const Ice::CommunicatorPtr&, const PasswordVerifierPrx&); + + void destroy(); + + RouterPrx startRouter(const std::string&, + const std::string&, + Ice::ByteSeq&, + Ice::ByteSeq&, + Ice::ByteSeq&, + const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; + Ice::LoggerPtr _logger; + Ice::PropertiesPtr _properties; + PasswordVerifierPrx _verifier; + int _traceLevel; + RSACertificateGenContext _certContext; + RSACertificateGen _certificateGenerator; +}; + +class CryptPasswordVerifierI : public PasswordVerifier, public IceUtil::Mutex +{ +public: + + CryptPasswordVerifierI(const std::map<std::string, std::string>&); + + virtual bool checkPassword(const std::string&, const std::string&, const Ice::Current&); + virtual void destroy(const Ice::Current&); + +private: + + const std::map<std::string, std::string> _passwords; +}; + +} + +#endif diff --git a/cpp/src/Ice/Acceptor.h b/cpp/src/Ice/Acceptor.h index de2513c749b..d690608903a 100644 --- a/cpp/src/Ice/Acceptor.h +++ b/cpp/src/Ice/Acceptor.h @@ -1,38 +1,38 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ACCEPTOR_H
-#define ICE_ACCEPTOR_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/AcceptorF.h>
-#include <Ice/TransceiverF.h>
-
-#ifndef _WIN32
-# define SOCKET int
-#endif
-
-namespace IceInternal
-{
-
-class ICE_PROTOCOL_API Acceptor : public ::IceUtil::Shared
-{
-public:
-
- virtual SOCKET fd() = 0;
- virtual void close() = 0;
- virtual void listen() = 0;
- virtual TransceiverPtr accept(int) = 0;
- virtual std::string toString() const = 0;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ACCEPTOR_H +#define ICE_ACCEPTOR_H + +#include <IceUtil/Shared.h> +#include <Ice/AcceptorF.h> +#include <Ice/TransceiverF.h> + +#ifndef _WIN32 +# define SOCKET int +#endif + +namespace IceInternal +{ + +class ICE_PROTOCOL_API Acceptor : public ::IceUtil::Shared +{ +public: + + virtual SOCKET fd() = 0; + virtual void close() = 0; + virtual void listen() = 0; + virtual TransceiverPtr accept(int) = 0; + virtual std::string toString() const = 0; +}; + +} + +#endif diff --git a/cpp/src/Ice/AcceptorF.h b/cpp/src/Ice/AcceptorF.h index a5358606309..b8eb80288d4 100644 --- a/cpp/src/Ice/AcceptorF.h +++ b/cpp/src/Ice/AcceptorF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ACCEPTOR_F_H
-#define ICE_ACCEPTOR_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Acceptor;
-ICE_PROTOCOL_API void incRef(Acceptor*);
-ICE_PROTOCOL_API void decRef(Acceptor*);
-typedef Handle<Acceptor> AcceptorPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ACCEPTOR_F_H +#define ICE_ACCEPTOR_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Acceptor; +ICE_PROTOCOL_API void incRef(Acceptor*); +ICE_PROTOCOL_API void decRef(Acceptor*); +typedef Handle<Acceptor> AcceptorPtr; + +} + +#endif diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 51a585cafe3..7e78e07efab 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -1,84 +1,84 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_COMMUNICATOR_I_H
-#define ICE_COMMUNICATOR_I_H
-
-#include <IceUtil/RecMutex.h>
-
-#include <Ice/ThreadPoolF.h>
-#include <Ice/Initialize.h>
-#include <Ice/Communicator.h>
-
-namespace Ice
-{
-
-class CommunicatorI : public Communicator, public ::IceUtil::RecMutex
-{
-public:
-
- virtual void destroy();
- virtual void shutdown();
- virtual void waitForShutdown();
-
- virtual ObjectPrx stringToProxy(const std::string&);
- virtual std::string proxyToString(const ObjectPrx&);
-
- virtual ObjectAdapterPtr createObjectAdapter(const std::string&);
- virtual ObjectAdapterPtr createObjectAdapterFromProperty(const std::string&, const std::string&);
- virtual ObjectAdapterPtr createObjectAdapterWithEndpoints(const std::string&, const std::string&);
-
- virtual void addObjectFactory(const ObjectFactoryPtr&, const std::string&);
- virtual void removeObjectFactory(const std::string&);
- virtual ObjectFactoryPtr findObjectFactory(const std::string&);
-
- virtual void addUserExceptionFactory(const UserExceptionFactoryPtr&, const std::string&);
- virtual void removeUserExceptionFactory(const std::string&);
- virtual UserExceptionFactoryPtr findUserExceptionFactory(const std::string&);
-
- virtual PropertiesPtr getProperties();
-
- virtual LoggerPtr getLogger();
- virtual void setLogger(const LoggerPtr&);
-
- virtual void setDefaultRouter(const RouterPrx&);
-
- virtual PluginManagerPtr getPluginManager();
-
-private:
-
- CommunicatorI(int&, char*[], const PropertiesPtr&);
- virtual ~CommunicatorI();
-
- //
- // Certain initialization tasks need to be completed after the
- // constructor.
- //
- void finishSetup(int&, char*[]);
-
- friend ICE_API CommunicatorPtr initialize(int&, char*[], Int);
- friend ICE_API CommunicatorPtr initializeWithProperties(int&, char*[], const PropertiesPtr&, Int);
- friend ICE_API ::IceInternal::InstancePtr IceInternal::getInstance(const ::Ice::CommunicatorPtr&);
-
- ::IceInternal::InstancePtr _instance;
-
- //
- // We need _serverThreadPool directly in CommunicatorI. That's
- // because the shutdown() operation is signal-safe, and thus must
- // not access any mutex locks or _instance. It may only access
- // _serverThreadPool->initiateShutdown(), which is signal-safe as
- // well.
- //
- ::IceInternal::ThreadPoolPtr _serverThreadPool;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_COMMUNICATOR_I_H +#define ICE_COMMUNICATOR_I_H + +#include <IceUtil/RecMutex.h> + +#include <Ice/ThreadPoolF.h> +#include <Ice/Initialize.h> +#include <Ice/Communicator.h> + +namespace Ice +{ + +class CommunicatorI : public Communicator, public ::IceUtil::RecMutex +{ +public: + + virtual void destroy(); + virtual void shutdown(); + virtual void waitForShutdown(); + + virtual ObjectPrx stringToProxy(const std::string&); + virtual std::string proxyToString(const ObjectPrx&); + + virtual ObjectAdapterPtr createObjectAdapter(const std::string&); + virtual ObjectAdapterPtr createObjectAdapterFromProperty(const std::string&, const std::string&); + virtual ObjectAdapterPtr createObjectAdapterWithEndpoints(const std::string&, const std::string&); + + virtual void addObjectFactory(const ObjectFactoryPtr&, const std::string&); + virtual void removeObjectFactory(const std::string&); + virtual ObjectFactoryPtr findObjectFactory(const std::string&); + + virtual void addUserExceptionFactory(const UserExceptionFactoryPtr&, const std::string&); + virtual void removeUserExceptionFactory(const std::string&); + virtual UserExceptionFactoryPtr findUserExceptionFactory(const std::string&); + + virtual PropertiesPtr getProperties(); + + virtual LoggerPtr getLogger(); + virtual void setLogger(const LoggerPtr&); + + virtual void setDefaultRouter(const RouterPrx&); + + virtual PluginManagerPtr getPluginManager(); + +private: + + CommunicatorI(int&, char*[], const PropertiesPtr&); + virtual ~CommunicatorI(); + + // + // Certain initialization tasks need to be completed after the + // constructor. + // + void finishSetup(int&, char*[]); + + friend ICE_API CommunicatorPtr initialize(int&, char*[], Int); + friend ICE_API CommunicatorPtr initializeWithProperties(int&, char*[], const PropertiesPtr&, Int); + friend ICE_API ::IceInternal::InstancePtr IceInternal::getInstance(const ::Ice::CommunicatorPtr&); + + ::IceInternal::InstancePtr _instance; + + // + // We need _serverThreadPool directly in CommunicatorI. That's + // because the shutdown() operation is signal-safe, and thus must + // not access any mutex locks or _instance. It may only access + // _serverThreadPool->initiateShutdown(), which is signal-safe as + // well. + // + ::IceInternal::ThreadPoolPtr _serverThreadPool; +}; + +} + +#endif diff --git a/cpp/src/Ice/Connection.h b/cpp/src/Ice/Connection.h index 010745d0dc1..0128cd029f8 100644 --- a/cpp/src/Ice/Connection.h +++ b/cpp/src/Ice/Connection.h @@ -1,121 +1,121 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTION_H
-#define ICE_CONNECTION_H
-
-#include <IceUtil/RecMutex.h>
-
-#include <Ice/ConnectionF.h>
-#include <Ice/ConnectionFactoryF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/TransceiverF.h>
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/EndpointF.h>
-#include <Ice/ThreadPoolF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/DefaultsAndOverridesF.h>
-#include <Ice/EventHandler.h>
-
-namespace Ice
-{
-
-class LocalException;
-
-}
-
-namespace IceInternal
-{
-
-class Outgoing;
-
-class Connection : public EventHandler, public ::IceUtil::RecMutex
-{
-public:
-
- bool destroyed() const;
- void hold();
- void activate();
- void incProxyUsageCount();
- void decProxyUsageCount();
- void prepareRequest(Outgoing*);
- void sendRequest(Outgoing*, bool, bool);
- void removeRequest(Outgoing*);
- void prepareBatchRequest(Outgoing*);
- void finishBatchRequest(Outgoing*);
- void abortBatchRequest();
- void flushBatchRequest(bool);
- int timeout() const;
- EndpointPtr endpoint() const;
- void setAdapter(const ::Ice::ObjectAdapterPtr&);
- ::Ice::ObjectAdapterPtr getAdapter() const;
-
- //
- // Operations from EventHandler
- //
- virtual bool readable() const;
- virtual void read(BasicStream&);
- virtual void message(BasicStream&, const ThreadPoolPtr&);
- virtual void finished(const ThreadPoolPtr&);
- virtual void exception(const ::Ice::LocalException&);
-
-private:
-
- Connection(const InstancePtr&, const TransceiverPtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&);
- virtual ~Connection();
- enum DestructionReason
- {
- ObjectAdapterDeactivated,
- CommunicatorDestroyed
- };
- void destroy(DestructionReason);
- friend class IncomingConnectionFactory;
- friend class OutgoingConnectionFactory;
-
- enum State
- {
- StateActive,
- StateHolding,
- StateClosing,
- StateClosed
- };
-
- void setState(State, const ::Ice::LocalException&);
- void setState(State);
- void closeConnection();
- void registerWithPool();
- void unregisterWithPool();
- void compress(BasicStream&, BasicStream&);
- void uncompress(BasicStream&, BasicStream&);
-
- TransceiverPtr _transceiver;
- EndpointPtr _endpoint;
- ::Ice::ObjectAdapterPtr _adapter;
- ::Ice::LoggerPtr _logger;
- TraceLevelsPtr _traceLevels;
- DefaultsAndOverridesPtr _defaultsAndOverrides;
- ThreadPoolPtr _clientThreadPool;
- ThreadPoolPtr _serverThreadPool;
- ::Ice::Int _nextRequestId;
- std::map< ::Ice::Int, Outgoing*> _requests;
- std::map< ::Ice::Int, Outgoing*>::iterator _requestsHint;
- std::auto_ptr< ::Ice::LocalException> _exception;
- BasicStream _batchStream;
- int _responseCount;
- int _proxyUsageCount;
- State _state;
- bool _warn;
- bool _registeredWithPool;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTION_H +#define ICE_CONNECTION_H + +#include <IceUtil/RecMutex.h> + +#include <Ice/ConnectionF.h> +#include <Ice/ConnectionFactoryF.h> +#include <Ice/InstanceF.h> +#include <Ice/TransceiverF.h> +#include <Ice/ObjectAdapterF.h> +#include <Ice/EndpointF.h> +#include <Ice/ThreadPoolF.h> +#include <Ice/LoggerF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/DefaultsAndOverridesF.h> +#include <Ice/EventHandler.h> + +namespace Ice +{ + +class LocalException; + +} + +namespace IceInternal +{ + +class Outgoing; + +class Connection : public EventHandler, public ::IceUtil::RecMutex +{ +public: + + bool destroyed() const; + void hold(); + void activate(); + void incProxyUsageCount(); + void decProxyUsageCount(); + void prepareRequest(Outgoing*); + void sendRequest(Outgoing*, bool, bool); + void removeRequest(Outgoing*); + void prepareBatchRequest(Outgoing*); + void finishBatchRequest(Outgoing*); + void abortBatchRequest(); + void flushBatchRequest(bool); + int timeout() const; + EndpointPtr endpoint() const; + void setAdapter(const ::Ice::ObjectAdapterPtr&); + ::Ice::ObjectAdapterPtr getAdapter() const; + + // + // Operations from EventHandler + // + virtual bool readable() const; + virtual void read(BasicStream&); + virtual void message(BasicStream&, const ThreadPoolPtr&); + virtual void finished(const ThreadPoolPtr&); + virtual void exception(const ::Ice::LocalException&); + +private: + + Connection(const InstancePtr&, const TransceiverPtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&); + virtual ~Connection(); + enum DestructionReason + { + ObjectAdapterDeactivated, + CommunicatorDestroyed + }; + void destroy(DestructionReason); + friend class IncomingConnectionFactory; + friend class OutgoingConnectionFactory; + + enum State + { + StateActive, + StateHolding, + StateClosing, + StateClosed + }; + + void setState(State, const ::Ice::LocalException&); + void setState(State); + void closeConnection(); + void registerWithPool(); + void unregisterWithPool(); + void compress(BasicStream&, BasicStream&); + void uncompress(BasicStream&, BasicStream&); + + TransceiverPtr _transceiver; + EndpointPtr _endpoint; + ::Ice::ObjectAdapterPtr _adapter; + ::Ice::LoggerPtr _logger; + TraceLevelsPtr _traceLevels; + DefaultsAndOverridesPtr _defaultsAndOverrides; + ThreadPoolPtr _clientThreadPool; + ThreadPoolPtr _serverThreadPool; + ::Ice::Int _nextRequestId; + std::map< ::Ice::Int, Outgoing*> _requests; + std::map< ::Ice::Int, Outgoing*>::iterator _requestsHint; + std::auto_ptr< ::Ice::LocalException> _exception; + BasicStream _batchStream; + int _responseCount; + int _proxyUsageCount; + State _state; + bool _warn; + bool _registeredWithPool; +}; + +} + +#endif diff --git a/cpp/src/Ice/ConnectionFactory.h b/cpp/src/Ice/ConnectionFactory.h index b09862fdd61..15fadcf3ca8 100644 --- a/cpp/src/Ice/ConnectionFactory.h +++ b/cpp/src/Ice/ConnectionFactory.h @@ -1,108 +1,108 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTION_FACTORY_H
-#define ICE_CONNECTION_FACTORY_H
-
-#include <IceUtil/RecMutex.h>
-#include <Ice/ConnectionFactoryF.h>
-#include <Ice/ConnectionF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/EndpointF.h>
-#include <Ice/AcceptorF.h>
-#include <Ice/TransceiverF.h>
-#include <Ice/RouterF.h>
-#include <Ice/EventHandler.h>
-#include <list>
-
-namespace Ice
-{
-
-class LocalException;
-class ObjectAdapterI;
-
-}
-
-namespace IceInternal
-{
-
-class OutgoingConnectionFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- ConnectionPtr create(const std::vector<EndpointPtr>&);
- void setRouter(const ::Ice::RouterPrx&);
- void removeAdapter(const ::Ice::ObjectAdapterPtr&);
-
-private:
-
- OutgoingConnectionFactory(const InstancePtr&);
- virtual ~OutgoingConnectionFactory();
- void destroy();
- friend class Instance;
-
- InstancePtr _instance;
- std::map<EndpointPtr, ConnectionPtr> _connections;
-};
-
-class IncomingConnectionFactory : public EventHandler, public ::IceUtil::Monitor< ::IceUtil::Mutex>
-{
-public:
-
- void hold();
- void activate();
-
- EndpointPtr endpoint() const;
- bool equivalent(const EndpointPtr&) const;
- std::list<ConnectionPtr> connections() const;
-
- //
- // Operations from EventHandler
- //
- virtual bool readable() const;
- virtual void read(BasicStream&);
- virtual void message(BasicStream&, const ThreadPoolPtr&);
- virtual void finished(const ThreadPoolPtr&);
- virtual void exception(const ::Ice::LocalException&);
-
-private:
-
- IncomingConnectionFactory(const InstancePtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&);
- virtual ~IncomingConnectionFactory();
- void destroy();
- void waitUntilFinished();
- friend class ::Ice::ObjectAdapterI;
-
- enum State
- {
- StateActive,
- StateHolding,
- StateClosed
- };
-
- void setState(State);
- void registerWithPool();
- void unregisterWithPool();
-
- EndpointPtr _endpoint;
- ::Ice::ObjectAdapterPtr _adapter;
- AcceptorPtr _acceptor;
- TransceiverPtr _transceiver;
- ThreadPoolPtr _serverThreadPool;
- std::list<ConnectionPtr> _connections;
- State _state;
- bool _warn;
- bool _registeredWithPool;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTION_FACTORY_H +#define ICE_CONNECTION_FACTORY_H + +#include <IceUtil/RecMutex.h> +#include <Ice/ConnectionFactoryF.h> +#include <Ice/ConnectionF.h> +#include <Ice/InstanceF.h> +#include <Ice/ObjectAdapterF.h> +#include <Ice/EndpointF.h> +#include <Ice/AcceptorF.h> +#include <Ice/TransceiverF.h> +#include <Ice/RouterF.h> +#include <Ice/EventHandler.h> +#include <list> + +namespace Ice +{ + +class LocalException; +class ObjectAdapterI; + +} + +namespace IceInternal +{ + +class OutgoingConnectionFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + ConnectionPtr create(const std::vector<EndpointPtr>&); + void setRouter(const ::Ice::RouterPrx&); + void removeAdapter(const ::Ice::ObjectAdapterPtr&); + +private: + + OutgoingConnectionFactory(const InstancePtr&); + virtual ~OutgoingConnectionFactory(); + void destroy(); + friend class Instance; + + InstancePtr _instance; + std::map<EndpointPtr, ConnectionPtr> _connections; +}; + +class IncomingConnectionFactory : public EventHandler, public ::IceUtil::Monitor< ::IceUtil::Mutex> +{ +public: + + void hold(); + void activate(); + + EndpointPtr endpoint() const; + bool equivalent(const EndpointPtr&) const; + std::list<ConnectionPtr> connections() const; + + // + // Operations from EventHandler + // + virtual bool readable() const; + virtual void read(BasicStream&); + virtual void message(BasicStream&, const ThreadPoolPtr&); + virtual void finished(const ThreadPoolPtr&); + virtual void exception(const ::Ice::LocalException&); + +private: + + IncomingConnectionFactory(const InstancePtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&); + virtual ~IncomingConnectionFactory(); + void destroy(); + void waitUntilFinished(); + friend class ::Ice::ObjectAdapterI; + + enum State + { + StateActive, + StateHolding, + StateClosed + }; + + void setState(State); + void registerWithPool(); + void unregisterWithPool(); + + EndpointPtr _endpoint; + ::Ice::ObjectAdapterPtr _adapter; + AcceptorPtr _acceptor; + TransceiverPtr _transceiver; + ThreadPoolPtr _serverThreadPool; + std::list<ConnectionPtr> _connections; + State _state; + bool _warn; + bool _registeredWithPool; +}; + +} + +#endif diff --git a/cpp/src/Ice/Connector.h b/cpp/src/Ice/Connector.h index 93ac46c09ac..8a07584d761 100644 --- a/cpp/src/Ice/Connector.h +++ b/cpp/src/Ice/Connector.h @@ -1,31 +1,31 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTOR_H
-#define ICE_CONNECTOR_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/ConnectorF.h>
-#include <Ice/TransceiverF.h>
-
-namespace IceInternal
-{
-
-class ICE_PROTOCOL_API Connector : public ::IceUtil::Shared
-{
-public:
-
- virtual TransceiverPtr connect(int) = 0;
- virtual std::string toString() const = 0;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTOR_H +#define ICE_CONNECTOR_H + +#include <IceUtil/Shared.h> +#include <Ice/ConnectorF.h> +#include <Ice/TransceiverF.h> + +namespace IceInternal +{ + +class ICE_PROTOCOL_API Connector : public ::IceUtil::Shared +{ +public: + + virtual TransceiverPtr connect(int) = 0; + virtual std::string toString() const = 0; +}; + +} + +#endif diff --git a/cpp/src/Ice/ConnectorF.h b/cpp/src/Ice/ConnectorF.h index 5e682ec543d..532a2ad0339 100644 --- a/cpp/src/Ice/ConnectorF.h +++ b/cpp/src/Ice/ConnectorF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_CONNECTOR_F_H
-#define ICE_CONNECTOR_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Connector;
-ICE_PROTOCOL_API void incRef(Connector*);
-ICE_PROTOCOL_API void decRef(Connector*);
-typedef Handle<Connector> ConnectorPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_CONNECTOR_F_H +#define ICE_CONNECTOR_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Connector; +ICE_PROTOCOL_API void incRef(Connector*); +ICE_PROTOCOL_API void decRef(Connector*); +typedef Handle<Connector> ConnectorPtr; + +} + +#endif diff --git a/cpp/src/Ice/DefaultsAndOverrides.h b/cpp/src/Ice/DefaultsAndOverrides.h index 7f865083e24..38e39c8e2a0 100644 --- a/cpp/src/Ice/DefaultsAndOverrides.h +++ b/cpp/src/Ice/DefaultsAndOverrides.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DEFAULTS_AND_OVERRIDES_H
-#define ICE_DEFAULTS_AND_OVERRIDES_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/DefaultsAndOverridesF.h>
-#include <Ice/PropertiesF.h>
-
-namespace IceInternal
-{
-
-class DefaultsAndOverrides : public ::IceUtil::Shared
-{
-public:
-
- DefaultsAndOverrides(const ::Ice::PropertiesPtr&);
-
- std::string defaultHost;
- std::string defaultProtocol;
- std::string defaultRouter;
-
- bool overrideTimeout;
- Ice::Int overrideTimeoutValue;
- bool overrideComppress;
- bool overrideComppressValue;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DEFAULTS_AND_OVERRIDES_H +#define ICE_DEFAULTS_AND_OVERRIDES_H + +#include <IceUtil/Shared.h> +#include <Ice/DefaultsAndOverridesF.h> +#include <Ice/PropertiesF.h> + +namespace IceInternal +{ + +class DefaultsAndOverrides : public ::IceUtil::Shared +{ +public: + + DefaultsAndOverrides(const ::Ice::PropertiesPtr&); + + std::string defaultHost; + std::string defaultProtocol; + std::string defaultRouter; + + bool overrideTimeout; + Ice::Int overrideTimeoutValue; + bool overrideComppress; + bool overrideComppressValue; +}; + +} + +#endif diff --git a/cpp/src/Ice/DefaultsAndOverridesF.h b/cpp/src/Ice/DefaultsAndOverridesF.h index bd5029e83e7..0772a93ee72 100644 --- a/cpp/src/Ice/DefaultsAndOverridesF.h +++ b/cpp/src/Ice/DefaultsAndOverridesF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DEFAULTS_AND_OVERRIDES_F_H
-#define ICE_DEFAULTS_AND_OVERRIDES_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class DefaultsAndOverrides;
-void incRef(DefaultsAndOverrides*);
-void decRef(DefaultsAndOverrides*);
-typedef Handle<DefaultsAndOverrides> DefaultsAndOverridesPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DEFAULTS_AND_OVERRIDES_F_H +#define ICE_DEFAULTS_AND_OVERRIDES_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class DefaultsAndOverrides; +void incRef(DefaultsAndOverrides*); +void decRef(DefaultsAndOverrides*); +typedef Handle<DefaultsAndOverrides> DefaultsAndOverridesPtr; + +} + +#endif diff --git a/cpp/src/Ice/Endpoint.h b/cpp/src/Ice/Endpoint.h index d66ce19a54f..d667f956064 100644 --- a/cpp/src/Ice/Endpoint.h +++ b/cpp/src/Ice/Endpoint.h @@ -1,120 +1,120 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_H
-#define ICE_ENDPOINT_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/EndpointF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/TransceiverF.h>
-#include <Ice/ConnectorF.h>
-#include <Ice/AcceptorF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class ICE_PROTOCOL_API Endpoint : public ::IceUtil::Shared
-{
-public:
-
- //
- // Marshal the endpoint
- //
- virtual void streamWrite(BasicStream*) const = 0;
-
- //
- // Convert the endpoint to its string form
- //
- virtual std::string toString() const = 0;
-
- //
- // Return the endpoint type
- //
- virtual ::Ice::Short type() const = 0;
-
- //
- // Return the timeout for the endpoint in milliseconds. 0 means
- // non-blocking, -1 means no timeout.
- //
- virtual ::Ice::Int timeout() const = 0;
-
- //
- // Return a new endpoint with a different timeout value, provided
- // that timeouts are supported by the endpoint. Otherwise the same
- // endpoint is returned.
- //
- virtual EndpointPtr timeout(::Ice::Int) const = 0;
-
- //
- // Return true if the endpoint is datagram-based.
- //
- virtual bool datagram() const = 0;
-
- //
- // Return true if the endpoint is secure.
- //
- virtual bool secure() const = 0;
-
- //
- // Return true if the endpoint type is unknown.
- //
- virtual bool unknown() const = 0;
-
- //
- // Return a client side transceiver for this endpoint, or null if a
- // transceiver can only be created by a connector.
- //
- virtual TransceiverPtr clientTransceiver() const = 0;
-
- //
- // Return a server side transceiver for this endpoint, or null if a
- // transceiver can only be created by an acceptor. In case a
- // transceiver is created, this operation also returns a new
- // "effective" endpoint, which might differ from this endpoint,
- // for example, if a dynamic port number is assigned.
- //
- virtual TransceiverPtr serverTransceiver(EndpointPtr&) const = 0;
-
- //
- // Return a connector for this endpoint, or null if no connector
- // is available.
- //
- virtual ConnectorPtr connector() const = 0;
-
- //
- // Return an acceptor for this endpoint, or null if no acceptors
- // is available. In case an acceptor is created, this operation
- // also returns a new "effective" endpoint, which might differ
- // from this endpoint, for example, if a dynamic port number is
- // assigned.
- //
- virtual AcceptorPtr acceptor(EndpointPtr&) const = 0;
-
- //
- // Check whether the endpoint is equivalent to a specific
- // Transceiver or Acceptor
- //
- virtual bool equivalent(const TransceiverPtr&) const = 0;
- virtual bool equivalent(const AcceptorPtr&) const = 0;
-
- //
- // Compare endpoints for sorting purposes
- //
- virtual bool operator==(const Endpoint&) const = 0;
- virtual bool operator!=(const Endpoint&) const = 0;
- virtual bool operator<(const Endpoint&) const = 0;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_H +#define ICE_ENDPOINT_H + +#include <IceUtil/Shared.h> +#include <Ice/EndpointF.h> +#include <Ice/InstanceF.h> +#include <Ice/TransceiverF.h> +#include <Ice/ConnectorF.h> +#include <Ice/AcceptorF.h> + +namespace IceInternal +{ + +class BasicStream; + +class ICE_PROTOCOL_API Endpoint : public ::IceUtil::Shared +{ +public: + + // + // Marshal the endpoint + // + virtual void streamWrite(BasicStream*) const = 0; + + // + // Convert the endpoint to its string form + // + virtual std::string toString() const = 0; + + // + // Return the endpoint type + // + virtual ::Ice::Short type() const = 0; + + // + // Return the timeout for the endpoint in milliseconds. 0 means + // non-blocking, -1 means no timeout. + // + virtual ::Ice::Int timeout() const = 0; + + // + // Return a new endpoint with a different timeout value, provided + // that timeouts are supported by the endpoint. Otherwise the same + // endpoint is returned. + // + virtual EndpointPtr timeout(::Ice::Int) const = 0; + + // + // Return true if the endpoint is datagram-based. + // + virtual bool datagram() const = 0; + + // + // Return true if the endpoint is secure. + // + virtual bool secure() const = 0; + + // + // Return true if the endpoint type is unknown. + // + virtual bool unknown() const = 0; + + // + // Return a client side transceiver for this endpoint, or null if a + // transceiver can only be created by a connector. + // + virtual TransceiverPtr clientTransceiver() const = 0; + + // + // Return a server side transceiver for this endpoint, or null if a + // transceiver can only be created by an acceptor. In case a + // transceiver is created, this operation also returns a new + // "effective" endpoint, which might differ from this endpoint, + // for example, if a dynamic port number is assigned. + // + virtual TransceiverPtr serverTransceiver(EndpointPtr&) const = 0; + + // + // Return a connector for this endpoint, or null if no connector + // is available. + // + virtual ConnectorPtr connector() const = 0; + + // + // Return an acceptor for this endpoint, or null if no acceptors + // is available. In case an acceptor is created, this operation + // also returns a new "effective" endpoint, which might differ + // from this endpoint, for example, if a dynamic port number is + // assigned. + // + virtual AcceptorPtr acceptor(EndpointPtr&) const = 0; + + // + // Check whether the endpoint is equivalent to a specific + // Transceiver or Acceptor + // + virtual bool equivalent(const TransceiverPtr&) const = 0; + virtual bool equivalent(const AcceptorPtr&) const = 0; + + // + // Compare endpoints for sorting purposes + // + virtual bool operator==(const Endpoint&) const = 0; + virtual bool operator!=(const Endpoint&) const = 0; + virtual bool operator<(const Endpoint&) const = 0; +}; + +} + +#endif diff --git a/cpp/src/Ice/EndpointFactoryManager.h b/cpp/src/Ice/EndpointFactoryManager.h index 807982cd61c..34f953f199c 100644 --- a/cpp/src/Ice/EndpointFactoryManager.h +++ b/cpp/src/Ice/EndpointFactoryManager.h @@ -1,47 +1,47 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_FACTORY_MANAGER_H
-#define ICE_ENDPOINT_FACTORY_MANAGER_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/InstanceF.h>
-#include <Ice/EndpointF.h>
-#include <Ice/EndpointFactoryF.h>
-#include <Ice/EndpointFactoryManagerF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class EndpointFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- void add(const EndpointFactoryPtr&);
- EndpointFactoryPtr get(::Ice::Short) const;
- EndpointPtr create(const std::string&) const;
- EndpointPtr read(BasicStream*) const;
-
-private:
-
- EndpointFactoryManager(const InstancePtr&);
- void destroy();
- friend class Instance;
-
- InstancePtr _instance;
- std::vector<EndpointFactoryPtr> _factories;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_FACTORY_MANAGER_H +#define ICE_ENDPOINT_FACTORY_MANAGER_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/InstanceF.h> +#include <Ice/EndpointF.h> +#include <Ice/EndpointFactoryF.h> +#include <Ice/EndpointFactoryManagerF.h> + +namespace IceInternal +{ + +class BasicStream; + +class EndpointFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + void add(const EndpointFactoryPtr&); + EndpointFactoryPtr get(::Ice::Short) const; + EndpointPtr create(const std::string&) const; + EndpointPtr read(BasicStream*) const; + +private: + + EndpointFactoryManager(const InstancePtr&); + void destroy(); + friend class Instance; + + InstancePtr _instance; + std::vector<EndpointFactoryPtr> _factories; +}; + +} + +#endif diff --git a/cpp/src/Ice/EndpointFactoryManagerF.h b/cpp/src/Ice/EndpointFactoryManagerF.h index afeea66cf24..2f5363e9eed 100644 --- a/cpp/src/Ice/EndpointFactoryManagerF.h +++ b/cpp/src/Ice/EndpointFactoryManagerF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ENDPOINT_FACTORY_MANAGER_F_H
-#define ICE_ENDPOINT_FACTORY_MANAGER_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class EndpointFactoryManager;
-void incRef(EndpointFactoryManager*);
-void decRef(EndpointFactoryManager*);
-typedef Handle<EndpointFactoryManager> EndpointFactoryManagerPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ENDPOINT_FACTORY_MANAGER_F_H +#define ICE_ENDPOINT_FACTORY_MANAGER_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class EndpointFactoryManager; +void incRef(EndpointFactoryManager*); +void decRef(EndpointFactoryManager*); +typedef Handle<EndpointFactoryManager> EndpointFactoryManagerPtr; + +} + +#endif diff --git a/cpp/src/Ice/EventHandler.h b/cpp/src/Ice/EventHandler.h index 02dbece7c9d..3205f077489 100644 --- a/cpp/src/Ice/EventHandler.h +++ b/cpp/src/Ice/EventHandler.h @@ -1,87 +1,87 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_EVENT_HANDLER_H
-#define ICE_EVENT_HANDLER_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/EventHandlerF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/ThreadPoolF.h>
-#include <Ice/BasicStream.h>
-
-namespace Ice
-{
-
-class LocalException;
-
-}
-
-namespace IceInternal
-{
-
-class EventHandler : public ::IceUtil::Shared
-{
-public:
-
- //
- // Return true if read() must be called before calling message().
- //
- virtual bool readable() const = 0;
-
- //
- // Read data via the event handler. May only be called if
- // readable() returns true.
- //
- virtual void read(BasicStream&) = 0;
-
- //
- // A complete message has been received.
- //
- virtual void message(BasicStream&, const ThreadPoolPtr&) = 0;
-
- //
- // Will be called if the event handler is finally
- // unregistered. (Calling unregister() does not unregister
- // immediately.)
- //
- virtual void finished(const ThreadPoolPtr&) = 0;
-
- //
- // Propagate an exception to the event handler.
- //
- virtual void exception(const ::Ice::LocalException&) = 0;
-
- //
- // Try to destroy the event handler. Returns false if the event
- // handler cannot be destroyed because it is in use, or true
- // otherwise.
- //
-// virtual bool tryDestroy(const ThreadPoolPtr&) = 0;
-
-protected:
-
- EventHandler(const InstancePtr&);
- virtual ~EventHandler();
-
- InstancePtr _instance;
-
-private:
-
- //
- // The _stream data member is for use by ThreadPool only
- //
- BasicStream _stream;
- friend class ThreadPool;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_EVENT_HANDLER_H +#define ICE_EVENT_HANDLER_H + +#include <IceUtil/Shared.h> +#include <Ice/EventHandlerF.h> +#include <Ice/InstanceF.h> +#include <Ice/ThreadPoolF.h> +#include <Ice/BasicStream.h> + +namespace Ice +{ + +class LocalException; + +} + +namespace IceInternal +{ + +class EventHandler : public ::IceUtil::Shared +{ +public: + + // + // Return true if read() must be called before calling message(). + // + virtual bool readable() const = 0; + + // + // Read data via the event handler. May only be called if + // readable() returns true. + // + virtual void read(BasicStream&) = 0; + + // + // A complete message has been received. + // + virtual void message(BasicStream&, const ThreadPoolPtr&) = 0; + + // + // Will be called if the event handler is finally + // unregistered. (Calling unregister() does not unregister + // immediately.) + // + virtual void finished(const ThreadPoolPtr&) = 0; + + // + // Propagate an exception to the event handler. + // + virtual void exception(const ::Ice::LocalException&) = 0; + + // + // Try to destroy the event handler. Returns false if the event + // handler cannot be destroyed because it is in use, or true + // otherwise. + // +// virtual bool tryDestroy(const ThreadPoolPtr&) = 0; + +protected: + + EventHandler(const InstancePtr&); + virtual ~EventHandler(); + + InstancePtr _instance; + +private: + + // + // The _stream data member is for use by ThreadPool only + // + BasicStream _stream; + friend class ThreadPool; +}; + +} + +#endif diff --git a/cpp/src/Ice/EventHandlerF.h b/cpp/src/Ice/EventHandlerF.h index 1bf5aa9aa8b..32a1379edfd 100644 --- a/cpp/src/Ice/EventHandlerF.h +++ b/cpp/src/Ice/EventHandlerF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_EVENT_HANDLER_F_H
-#define ICE_EVENT_HANDLER_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class EventHandler;
-void incRef(EventHandler*);
-void decRef(EventHandler*);
-typedef Handle<EventHandler> EventHandlerPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_EVENT_HANDLER_F_H +#define ICE_EVENT_HANDLER_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class EventHandler; +void incRef(EventHandler*); +void decRef(EventHandler*); +typedef Handle<EventHandler> EventHandlerPtr; + +} + +#endif diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index f69a8e40f38..7cc4ec3ff0b 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -1,105 +1,105 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_INSTANCE_H
-#define ICE_INSTANCE_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <IceUtil/RecMutex.h>
-#include <Ice/InstanceF.h>
-#include <Ice/CommunicatorF.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/DefaultsAndOverridesF.h>
-#include <Ice/RouterInfoF.h>
-#include <Ice/ReferenceFactoryF.h>
-#include <Ice/ProxyFactoryF.h>
-#include <Ice/ThreadPoolF.h>
-#include <Ice/ConnectionFactoryF.h>
-#include <Ice/ObjectFactoryManagerF.h>
-#include <Ice/UserExceptionFactoryManagerF.h>
-#include <Ice/ObjectAdapterFactoryF.h>
-#include <Ice/EndpointFactoryManagerF.h>
-#include <Ice/PluginF.h>
-#include <list>
-
-namespace Ice
-{
-
-class CommunicatorI;
-
-}
-
-namespace IceInternal
-{
-
-class Instance : public ::IceUtil::Shared, public ::IceUtil::RecMutex
-{
-public:
-
- ::Ice::CommunicatorPtr communicator();
- ::Ice::PropertiesPtr properties();
- ::Ice::LoggerPtr logger();
- void logger(const ::Ice::LoggerPtr&);
- TraceLevelsPtr traceLevels();
- DefaultsAndOverridesPtr defaultsAndOverrides();
- RouterManagerPtr routerManager();
- ReferenceFactoryPtr referenceFactory();
- ProxyFactoryPtr proxyFactory();
- OutgoingConnectionFactoryPtr outgoingConnectionFactory();
- ObjectFactoryManagerPtr servantFactoryManager();
- UserExceptionFactoryManagerPtr userExceptionFactoryManager();
- ObjectAdapterFactoryPtr objectAdapterFactory();
- ThreadPoolPtr clientThreadPool();
- ThreadPoolPtr serverThreadPool();
- EndpointFactoryManagerPtr endpointFactoryManager();
- ::Ice::PluginManagerPtr pluginManager();
-
-private:
-
- Instance(const ::Ice::CommunicatorPtr&, int&, char*[], const ::Ice::PropertiesPtr&);
- virtual ~Instance();
- void finishSetup(int&, char*[]);
- void destroy();
- friend class ::Ice::CommunicatorI;
-
- ::Ice::CommunicatorPtr _communicator;
- ::Ice::PropertiesPtr _properties; // Immutable, not reset by destroy().
- ::Ice::LoggerPtr _logger; // Not reset by destroy().
- TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy().
- DefaultsAndOverridesPtr _defaultsAndOverrides; // Immutable, not reset by destroy().
- RouterManagerPtr _routerManager;
- ReferenceFactoryPtr _referenceFactory;
- ProxyFactoryPtr _proxyFactory;
- OutgoingConnectionFactoryPtr _outgoingConnectionFactory;
- ObjectFactoryManagerPtr _servantFactoryManager;
- UserExceptionFactoryManagerPtr _userExceptionFactoryManager;
- ObjectAdapterFactoryPtr _objectAdapterFactory;
- ThreadPoolPtr _clientThreadPool;
- ThreadPoolPtr _serverThreadPool;
- EndpointFactoryManagerPtr _endpointFactoryManager;
- ::Ice::PluginManagerPtr _pluginManager;
-
- //
- // Global state management
- //
- friend class GlobalStateMutexDestroyer;
- static int _globalStateCounter;
- static ::IceUtil::Mutex* _globalStateMutex;
-#ifndef _WIN32
- static std::string _identForOpenlog;
-#endif
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_INSTANCE_H +#define ICE_INSTANCE_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <IceUtil/RecMutex.h> +#include <Ice/InstanceF.h> +#include <Ice/CommunicatorF.h> +#include <Ice/PropertiesF.h> +#include <Ice/LoggerF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/DefaultsAndOverridesF.h> +#include <Ice/RouterInfoF.h> +#include <Ice/ReferenceFactoryF.h> +#include <Ice/ProxyFactoryF.h> +#include <Ice/ThreadPoolF.h> +#include <Ice/ConnectionFactoryF.h> +#include <Ice/ObjectFactoryManagerF.h> +#include <Ice/UserExceptionFactoryManagerF.h> +#include <Ice/ObjectAdapterFactoryF.h> +#include <Ice/EndpointFactoryManagerF.h> +#include <Ice/PluginF.h> +#include <list> + +namespace Ice +{ + +class CommunicatorI; + +} + +namespace IceInternal +{ + +class Instance : public ::IceUtil::Shared, public ::IceUtil::RecMutex +{ +public: + + ::Ice::CommunicatorPtr communicator(); + ::Ice::PropertiesPtr properties(); + ::Ice::LoggerPtr logger(); + void logger(const ::Ice::LoggerPtr&); + TraceLevelsPtr traceLevels(); + DefaultsAndOverridesPtr defaultsAndOverrides(); + RouterManagerPtr routerManager(); + ReferenceFactoryPtr referenceFactory(); + ProxyFactoryPtr proxyFactory(); + OutgoingConnectionFactoryPtr outgoingConnectionFactory(); + ObjectFactoryManagerPtr servantFactoryManager(); + UserExceptionFactoryManagerPtr userExceptionFactoryManager(); + ObjectAdapterFactoryPtr objectAdapterFactory(); + ThreadPoolPtr clientThreadPool(); + ThreadPoolPtr serverThreadPool(); + EndpointFactoryManagerPtr endpointFactoryManager(); + ::Ice::PluginManagerPtr pluginManager(); + +private: + + Instance(const ::Ice::CommunicatorPtr&, int&, char*[], const ::Ice::PropertiesPtr&); + virtual ~Instance(); + void finishSetup(int&, char*[]); + void destroy(); + friend class ::Ice::CommunicatorI; + + ::Ice::CommunicatorPtr _communicator; + ::Ice::PropertiesPtr _properties; // Immutable, not reset by destroy(). + ::Ice::LoggerPtr _logger; // Not reset by destroy(). + TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy(). + DefaultsAndOverridesPtr _defaultsAndOverrides; // Immutable, not reset by destroy(). + RouterManagerPtr _routerManager; + ReferenceFactoryPtr _referenceFactory; + ProxyFactoryPtr _proxyFactory; + OutgoingConnectionFactoryPtr _outgoingConnectionFactory; + ObjectFactoryManagerPtr _servantFactoryManager; + UserExceptionFactoryManagerPtr _userExceptionFactoryManager; + ObjectAdapterFactoryPtr _objectAdapterFactory; + ThreadPoolPtr _clientThreadPool; + ThreadPoolPtr _serverThreadPool; + EndpointFactoryManagerPtr _endpointFactoryManager; + ::Ice::PluginManagerPtr _pluginManager; + + // + // Global state management + // + friend class GlobalStateMutexDestroyer; + static int _globalStateCounter; + static ::IceUtil::Mutex* _globalStateMutex; +#ifndef _WIN32 + static std::string _identForOpenlog; +#endif +}; + +} + +#endif diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 25ac67eebe1..d7866b8e462 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -1,31 +1,31 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_LOGGER_I_H
-#define ICE_LOGGER_I_H
-
-#include <IceUtil/Mutex.h>
-#include <Ice/Logger.h>
-
-namespace Ice
-{
-
-class LoggerI : public Logger, public ::IceUtil::Mutex
-{
-public:
-
- virtual void trace(const std::string&, const std::string&);
- virtual void warning(const std::string&);
- virtual void error(const std::string&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_LOGGER_I_H +#define ICE_LOGGER_I_H + +#include <IceUtil/Mutex.h> +#include <Ice/Logger.h> + +namespace Ice +{ + +class LoggerI : public Logger, public ::IceUtil::Mutex +{ +public: + + virtual void trace(const std::string&, const std::string&); + virtual void warning(const std::string&); + virtual void error(const std::string&); +}; + +} + +#endif diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h index ac57f0b15ae..4196c109080 100644 --- a/cpp/src/Ice/Network.h +++ b/cpp/src/Ice/Network.h @@ -1,100 +1,100 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_NETWORK_H
-#define ICE_NETWORK_H
-
-#include <Ice/Config.h>
-
-#ifdef _WIN32
-# include <winsock.h>
-#else
-# include <unistd.h>
-# include <fcntl.h>
-# include <sys/socket.h>
-# include <sys/select.h>
-# include <netinet/in.h>
-# include <netinet/tcp.h>
-# include <arpa/inet.h>
-# include <netdb.h>
-#endif
-
-#ifdef _WIN32
-typedef int socklen_t;
-#endif
-
-#ifndef _WIN32
-# define SOCKET int
-# define SOCKET_ERROR -1
-# define INVALID_SOCKET -1
-#endif
-
-#ifndef SHUT_RD
-# define SHUT_RD 0
-#endif
-
-#ifndef SHUT_WR
-# define SHUT_WR 1
-#endif
-
-#ifndef SHUT_RDWR
-# define SHUT_RDWR 2
-#endif
-
-#ifndef NETDB_INTERNAL
-# define NETDB_INTERNAL -1
-#endif
-
-#ifndef NETDB_SUCCESS
-# define NETDB_SUCCESS 0
-#endif
-
-namespace IceInternal
-{
-
-ICE_PROTOCOL_API bool interrupted();
-ICE_PROTOCOL_API bool acceptInterrupted();
-ICE_PROTOCOL_API bool noBuffers();
-ICE_PROTOCOL_API bool wouldBlock();
-ICE_PROTOCOL_API bool connectFailed();
-ICE_PROTOCOL_API bool connectInProgress();
-ICE_PROTOCOL_API bool connectionLost();
-ICE_PROTOCOL_API bool notConnected();
-
-ICE_PROTOCOL_API SOCKET createSocket(bool);
-ICE_PROTOCOL_API void closeSocket(SOCKET);
-
-ICE_PROTOCOL_API void setBlock(SOCKET, bool);
-ICE_PROTOCOL_API void setTcpNoDelay(SOCKET);
-ICE_PROTOCOL_API void setKeepAlive(SOCKET);
-ICE_PROTOCOL_API void setSendBufferSize(SOCKET, int);
-
-ICE_PROTOCOL_API void doBind(SOCKET, struct sockaddr_in&);
-ICE_PROTOCOL_API void doListen(SOCKET, int);
-ICE_PROTOCOL_API void doConnect(SOCKET, struct sockaddr_in&, int);
-ICE_PROTOCOL_API SOCKET doAccept(SOCKET, int);
-
-ICE_PROTOCOL_API void getAddress(const std::string&, int, struct sockaddr_in&);
-ICE_PROTOCOL_API std::string getLocalHost(bool);
-ICE_PROTOCOL_API bool compareAddress(const struct sockaddr_in&, const struct sockaddr_in&);
-
-ICE_PROTOCOL_API void createPipe(SOCKET fds[2]);
-
-ICE_PROTOCOL_API std::string errorToString(int);
-ICE_PROTOCOL_API std::string errorToStringDNS(int);
-ICE_PROTOCOL_API std::string lastErrorToString();
-ICE_PROTOCOL_API std::string lastErrorToStringDNS();
-
-ICE_PROTOCOL_API std::string fdToString(SOCKET);
-ICE_PROTOCOL_API std::string addrToString(const struct sockaddr_in&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_NETWORK_H +#define ICE_NETWORK_H + +#include <Ice/Config.h> + +#ifdef _WIN32 +# include <winsock.h> +#else +# include <unistd.h> +# include <fcntl.h> +# include <sys/socket.h> +# include <sys/select.h> +# include <netinet/in.h> +# include <netinet/tcp.h> +# include <arpa/inet.h> +# include <netdb.h> +#endif + +#ifdef _WIN32 +typedef int socklen_t; +#endif + +#ifndef _WIN32 +# define SOCKET int +# define SOCKET_ERROR -1 +# define INVALID_SOCKET -1 +#endif + +#ifndef SHUT_RD +# define SHUT_RD 0 +#endif + +#ifndef SHUT_WR +# define SHUT_WR 1 +#endif + +#ifndef SHUT_RDWR +# define SHUT_RDWR 2 +#endif + +#ifndef NETDB_INTERNAL +# define NETDB_INTERNAL -1 +#endif + +#ifndef NETDB_SUCCESS +# define NETDB_SUCCESS 0 +#endif + +namespace IceInternal +{ + +ICE_PROTOCOL_API bool interrupted(); +ICE_PROTOCOL_API bool acceptInterrupted(); +ICE_PROTOCOL_API bool noBuffers(); +ICE_PROTOCOL_API bool wouldBlock(); +ICE_PROTOCOL_API bool connectFailed(); +ICE_PROTOCOL_API bool connectInProgress(); +ICE_PROTOCOL_API bool connectionLost(); +ICE_PROTOCOL_API bool notConnected(); + +ICE_PROTOCOL_API SOCKET createSocket(bool); +ICE_PROTOCOL_API void closeSocket(SOCKET); + +ICE_PROTOCOL_API void setBlock(SOCKET, bool); +ICE_PROTOCOL_API void setTcpNoDelay(SOCKET); +ICE_PROTOCOL_API void setKeepAlive(SOCKET); +ICE_PROTOCOL_API void setSendBufferSize(SOCKET, int); + +ICE_PROTOCOL_API void doBind(SOCKET, struct sockaddr_in&); +ICE_PROTOCOL_API void doListen(SOCKET, int); +ICE_PROTOCOL_API void doConnect(SOCKET, struct sockaddr_in&, int); +ICE_PROTOCOL_API SOCKET doAccept(SOCKET, int); + +ICE_PROTOCOL_API void getAddress(const std::string&, int, struct sockaddr_in&); +ICE_PROTOCOL_API std::string getLocalHost(bool); +ICE_PROTOCOL_API bool compareAddress(const struct sockaddr_in&, const struct sockaddr_in&); + +ICE_PROTOCOL_API void createPipe(SOCKET fds[2]); + +ICE_PROTOCOL_API std::string errorToString(int); +ICE_PROTOCOL_API std::string errorToStringDNS(int); +ICE_PROTOCOL_API std::string lastErrorToString(); +ICE_PROTOCOL_API std::string lastErrorToStringDNS(); + +ICE_PROTOCOL_API std::string fdToString(SOCKET); +ICE_PROTOCOL_API std::string addrToString(const struct sockaddr_in&); + +} + +#endif diff --git a/cpp/src/Ice/ObjectAdapterFactory.h b/cpp/src/Ice/ObjectAdapterFactory.h index 0eeb03c956f..b9a10c46aa2 100644 --- a/cpp/src/Ice/ObjectAdapterFactory.h +++ b/cpp/src/Ice/ObjectAdapterFactory.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OBJECT_ADAPTER_FACTORY_H
-#define ICE_OBJECT_ADAPTER_FACTORY_H
-
-#include <Ice/ObjectAdapterI.h>
-#include <IceUtil/RecMutex.h>
-
-namespace IceInternal
-{
-
-class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::RecMutex
-{
-public:
-
- void shutdown();
- ::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string&);
- ::Ice::ObjectAdapterPtr findObjectAdapter(const ::Ice::ObjectPrx&);
-
-private:
-
- ObjectAdapterFactory(const InstancePtr&);
- friend class Instance;
-
- InstancePtr _instance;
- std::map<std::string, ::Ice::ObjectAdapterIPtr> _adapters;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OBJECT_ADAPTER_FACTORY_H +#define ICE_OBJECT_ADAPTER_FACTORY_H + +#include <Ice/ObjectAdapterI.h> +#include <IceUtil/RecMutex.h> + +namespace IceInternal +{ + +class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::RecMutex +{ +public: + + void shutdown(); + ::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string&); + ::Ice::ObjectAdapterPtr findObjectAdapter(const ::Ice::ObjectPrx&); + +private: + + ObjectAdapterFactory(const InstancePtr&); + friend class Instance; + + InstancePtr _instance; + std::map<std::string, ::Ice::ObjectAdapterIPtr> _adapters; +}; + +} + +#endif diff --git a/cpp/src/Ice/ObjectAdapterI.h b/cpp/src/Ice/ObjectAdapterI.h index b31e15626f4..e9378be1c67 100644 --- a/cpp/src/Ice/ObjectAdapterI.h +++ b/cpp/src/Ice/ObjectAdapterI.h @@ -1,86 +1,86 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OBJECT_ADAPTER_I_H
-#define ICE_OBJECT_ADAPTER_I_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ObjectAdapter.h>
-#include <Ice/InstanceF.h>
-#include <Ice/ObjectAdapterFactoryF.h>
-#include <Ice/CommunicatorF.h>
-#include <Ice/ConnectionFactoryF.h>
-#include <Ice/ProxyF.h>
-#include <Ice/ObjectF.h>
-#include <Ice/Exception.h>
-#include <Ice/EndpointF.h>
-#include <list>
-
-namespace Ice
-{
-
-class ObjectAdapterI;
-typedef IceUtil::Handle<ObjectAdapterI> ObjectAdapterIPtr;
-
-class ObjectAdapterI : public ObjectAdapter, public ::IceUtil::Mutex
-{
-public:
-
- virtual std::string getName();
- virtual CommunicatorPtr getCommunicator();
-
- virtual void activate();
- virtual void hold();
- virtual void deactivate();
- virtual void waitForDeactivate();
-
- virtual ObjectPrx add(const ObjectPtr&, const Identity&);
- virtual ObjectPrx addWithUUID(const ObjectPtr&);
- virtual void remove(const Identity&);
-
- virtual void addServantLocator(const ServantLocatorPtr&, const std::string&);
- virtual void removeServantLocator(const std::string&);
- virtual ServantLocatorPtr findServantLocator(const std::string&);
-
- virtual ObjectPtr identityToServant(const Identity&);
- virtual ObjectPtr proxyToServant(const ObjectPrx&);
-
- virtual ObjectPrx createProxy(const Identity&);
- virtual ObjectPrx createReverseProxy(const Identity&);
-
- virtual void addRouter(const RouterPrx&);
-
- std::list< ::IceInternal::ConnectionPtr> getIncomingConnections() const;
-
-private:
-
- ObjectAdapterI(const ::IceInternal::InstancePtr&, const std::string&, const std::string&);
- virtual ~ObjectAdapterI();
- friend class ::IceInternal::ObjectAdapterFactory;
-
- ObjectPrx newProxy(const Identity&) const;
- bool isLocal(const ObjectPrx&) const;
-
- ::IceInternal::InstancePtr _instance;
- bool _printAdapterReadyDone;
- std::string _name;
- ObjectDict _activeServantMap;
- ObjectDict::iterator _activeServantMapHint;
- std::map<std::string, ServantLocatorPtr> _locatorMap;
- std::map<std::string, ServantLocatorPtr>::iterator _locatorMapHint;
- std::vector< ::IceInternal::IncomingConnectionFactoryPtr> _incomingConnectionFactories;
- std::vector< ::IceInternal::EndpointPtr> _routerEndpoints;
- IceUtil::Mutex _routerEndpointsMutex;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OBJECT_ADAPTER_I_H +#define ICE_OBJECT_ADAPTER_I_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ObjectAdapter.h> +#include <Ice/InstanceF.h> +#include <Ice/ObjectAdapterFactoryF.h> +#include <Ice/CommunicatorF.h> +#include <Ice/ConnectionFactoryF.h> +#include <Ice/ProxyF.h> +#include <Ice/ObjectF.h> +#include <Ice/Exception.h> +#include <Ice/EndpointF.h> +#include <list> + +namespace Ice +{ + +class ObjectAdapterI; +typedef IceUtil::Handle<ObjectAdapterI> ObjectAdapterIPtr; + +class ObjectAdapterI : public ObjectAdapter, public ::IceUtil::Mutex +{ +public: + + virtual std::string getName(); + virtual CommunicatorPtr getCommunicator(); + + virtual void activate(); + virtual void hold(); + virtual void deactivate(); + virtual void waitForDeactivate(); + + virtual ObjectPrx add(const ObjectPtr&, const Identity&); + virtual ObjectPrx addWithUUID(const ObjectPtr&); + virtual void remove(const Identity&); + + virtual void addServantLocator(const ServantLocatorPtr&, const std::string&); + virtual void removeServantLocator(const std::string&); + virtual ServantLocatorPtr findServantLocator(const std::string&); + + virtual ObjectPtr identityToServant(const Identity&); + virtual ObjectPtr proxyToServant(const ObjectPrx&); + + virtual ObjectPrx createProxy(const Identity&); + virtual ObjectPrx createReverseProxy(const Identity&); + + virtual void addRouter(const RouterPrx&); + + std::list< ::IceInternal::ConnectionPtr> getIncomingConnections() const; + +private: + + ObjectAdapterI(const ::IceInternal::InstancePtr&, const std::string&, const std::string&); + virtual ~ObjectAdapterI(); + friend class ::IceInternal::ObjectAdapterFactory; + + ObjectPrx newProxy(const Identity&) const; + bool isLocal(const ObjectPrx&) const; + + ::IceInternal::InstancePtr _instance; + bool _printAdapterReadyDone; + std::string _name; + ObjectDict _activeServantMap; + ObjectDict::iterator _activeServantMapHint; + std::map<std::string, ServantLocatorPtr> _locatorMap; + std::map<std::string, ServantLocatorPtr>::iterator _locatorMapHint; + std::vector< ::IceInternal::IncomingConnectionFactoryPtr> _incomingConnectionFactories; + std::vector< ::IceInternal::EndpointPtr> _routerEndpoints; + IceUtil::Mutex _routerEndpointsMutex; +}; + +} + +#endif diff --git a/cpp/src/Ice/ObjectFactoryManager.h b/cpp/src/Ice/ObjectFactoryManager.h index df0415714a3..c10cd4fe09c 100644 --- a/cpp/src/Ice/ObjectFactoryManager.h +++ b/cpp/src/Ice/ObjectFactoryManager.h @@ -1,42 +1,42 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SERVANT_FACTORY_MANAGER_H
-#define ICE_SERVANT_FACTORY_MANAGER_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ObjectFactoryManagerF.h>
-#include <Ice/ObjectFactoryF.h>
-
-namespace IceInternal
-{
-
-class ObjectFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- void add(const ::Ice::ObjectFactoryPtr&, const std::string&);
- void remove(const std::string&);
- ::Ice::ObjectFactoryPtr find(const std::string&);
-
-private:
-
- ObjectFactoryManager();
- void destroy();
- friend class Instance;
-
- std::map<std::string, ::Ice::ObjectFactoryPtr> _factoryMap;
- std::map<std::string, ::Ice::ObjectFactoryPtr>::iterator _factoryMapHint;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SERVANT_FACTORY_MANAGER_H +#define ICE_SERVANT_FACTORY_MANAGER_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ObjectFactoryManagerF.h> +#include <Ice/ObjectFactoryF.h> + +namespace IceInternal +{ + +class ObjectFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + void add(const ::Ice::ObjectFactoryPtr&, const std::string&); + void remove(const std::string&); + ::Ice::ObjectFactoryPtr find(const std::string&); + +private: + + ObjectFactoryManager(); + void destroy(); + friend class Instance; + + std::map<std::string, ::Ice::ObjectFactoryPtr> _factoryMap; + std::map<std::string, ::Ice::ObjectFactoryPtr>::iterator _factoryMapHint; +}; + +} + +#endif diff --git a/cpp/src/Ice/ObjectFactoryManagerF.h b/cpp/src/Ice/ObjectFactoryManagerF.h index 7f61f76cc2f..c9d1bd79004 100644 --- a/cpp/src/Ice/ObjectFactoryManagerF.h +++ b/cpp/src/Ice/ObjectFactoryManagerF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SERVANT_FACTORY_MANAGER_F_H
-#define ICE_SERVANT_FACTORY_MANAGER_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ObjectFactoryManager;
-void incRef(ObjectFactoryManager*);
-void decRef(ObjectFactoryManager*);
-typedef Handle<ObjectFactoryManager> ObjectFactoryManagerPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SERVANT_FACTORY_MANAGER_F_H +#define ICE_SERVANT_FACTORY_MANAGER_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ObjectFactoryManager; +void incRef(ObjectFactoryManager*); +void decRef(ObjectFactoryManager*); +typedef Handle<ObjectFactoryManager> ObjectFactoryManagerPtr; + +} + +#endif diff --git a/cpp/src/Ice/PicklerI.h b/cpp/src/Ice/PicklerI.h index 41d694dceb3..cbe7358bae4 100644 --- a/cpp/src/Ice/PicklerI.h +++ b/cpp/src/Ice/PicklerI.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PICKLER_I_H
-#define ICE_PICKLER_I_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/Pickler.h>
-#include <Ice/InstanceF.h>
-
-namespace Ice
-{
-
-class ICE_API PicklerI : public Pickler
-{
-public:
-
- void pickle(const ObjectPtr&, std::ostream&);
- ObjectPtr unpickle(const std::string&, std::istream&);
-
-private:
-
- PicklerI(const ::IceInternal::InstancePtr&);
- friend ::IceInternal::Instance;
-
- ::IceInternal::InstancePtr _instance;
-};
-
-}
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PICKLER_I_H +#define ICE_PICKLER_I_H + +#include <IceUtil/Shared.h> +#include <Ice/Pickler.h> +#include <Ice/InstanceF.h> + +namespace Ice +{ + +class ICE_API PicklerI : public Pickler +{ +public: + + void pickle(const ObjectPtr&, std::ostream&); + ObjectPtr unpickle(const std::string&, std::istream&); + +private: + + PicklerI(const ::IceInternal::InstancePtr&); + friend ::IceInternal::Instance; + + ::IceInternal::InstancePtr _instance; +}; + +} + +#endif + diff --git a/cpp/src/Ice/PluginManagerI.h b/cpp/src/Ice/PluginManagerI.h index e668b6afc4d..60663ffdc38 100644 --- a/cpp/src/Ice/PluginManagerI.h +++ b/cpp/src/Ice/PluginManagerI.h @@ -1,55 +1,55 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PLUGIN_MANAGER_I_H
-#define ICE_PLUGIN_MANAGER_I_H
-
-#include <Ice/Plugin.h>
-#include <Ice/InstanceF.h>
-#include <Ice/CommunicatorF.h>
-#include <Ice/DynamicLibraryF.h>
-#include <Ice/BuiltinSequences.h>
-#include <IceUtil/Mutex.h>
-#include <map>
-
-namespace Ice
-{
-
-class PluginManagerI : public PluginManager, public IceUtil::Mutex
-{
-public:
-
- virtual PluginPtr getPlugin(const std::string&);
-
- virtual void addPlugin(const std::string&, const PluginPtr&);
-
- virtual void destroy();
-
- struct PluginInfo
- {
- PluginPtr plugin;
- IceInternal::DynamicLibraryPtr library;
- };
-
-private:
-
- PluginManagerI(const IceInternal::InstancePtr&);
- void loadPlugins(int&, char*[]);
- friend class IceInternal::Instance;
-
- void loadPlugin(const std::string&, const std::string&, const StringSeq&);
-
- IceInternal::InstancePtr _instance;
- std::map<std::string, PluginInfo> _plugins;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PLUGIN_MANAGER_I_H +#define ICE_PLUGIN_MANAGER_I_H + +#include <Ice/Plugin.h> +#include <Ice/InstanceF.h> +#include <Ice/CommunicatorF.h> +#include <Ice/DynamicLibraryF.h> +#include <Ice/BuiltinSequences.h> +#include <IceUtil/Mutex.h> +#include <map> + +namespace Ice +{ + +class PluginManagerI : public PluginManager, public IceUtil::Mutex +{ +public: + + virtual PluginPtr getPlugin(const std::string&); + + virtual void addPlugin(const std::string&, const PluginPtr&); + + virtual void destroy(); + + struct PluginInfo + { + PluginPtr plugin; + IceInternal::DynamicLibraryPtr library; + }; + +private: + + PluginManagerI(const IceInternal::InstancePtr&); + void loadPlugins(int&, char*[]); + friend class IceInternal::Instance; + + void loadPlugin(const std::string&, const std::string&, const StringSeq&); + + IceInternal::InstancePtr _instance; + std::map<std::string, PluginInfo> _plugins; +}; + +} + +#endif diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h index 954e3d37d75..da843b70611 100644 --- a/cpp/src/Ice/PropertiesI.h +++ b/cpp/src/Ice/PropertiesI.h @@ -1,54 +1,54 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROPERTIES_I_H
-#define ICE_PROPERTIES_I_H
-
-#include <IceUtil/Mutex.h>
-#include <Ice/Properties.h>
-#include <set>
-
-namespace Ice
-{
-
-class ICE_API PropertiesI : public Properties, public IceUtil::Mutex
-{
-public:
-
- virtual std::string getProperty(const std::string&);
- virtual std::string getPropertyWithDefault(const std::string&, const std::string&);
- virtual Ice::Int getPropertyAsInt(const std::string&);
- virtual Ice::Int getPropertyAsIntWithDefault(const std::string&, Ice::Int);
- virtual PropertyDict getPropertiesForPrefix(const std::string&);
- virtual void setProperty(const std::string&, const std::string&);
- virtual StringSeq getCommandLineOptions();
- virtual StringSeq parseCommandLineOptions(const std::string&, const StringSeq&);
- virtual void load(const std::string&);
- virtual PropertiesPtr clone();
-
-private:
-
- PropertiesI();
- PropertiesI(StringSeq&);
- PropertiesI(int&, char*[]);
- friend ICE_API PropertiesPtr createProperties();
- friend ICE_API PropertiesPtr createProperties(StringSeq&);
- friend ICE_API PropertiesPtr createProperties(int&, char*[]);
-
- void parseLine(const std::string&);
-
- void loadConfig();
-
- std::map<std::string, std::string> _properties;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROPERTIES_I_H +#define ICE_PROPERTIES_I_H + +#include <IceUtil/Mutex.h> +#include <Ice/Properties.h> +#include <set> + +namespace Ice +{ + +class ICE_API PropertiesI : public Properties, public IceUtil::Mutex +{ +public: + + virtual std::string getProperty(const std::string&); + virtual std::string getPropertyWithDefault(const std::string&, const std::string&); + virtual Ice::Int getPropertyAsInt(const std::string&); + virtual Ice::Int getPropertyAsIntWithDefault(const std::string&, Ice::Int); + virtual PropertyDict getPropertiesForPrefix(const std::string&); + virtual void setProperty(const std::string&, const std::string&); + virtual StringSeq getCommandLineOptions(); + virtual StringSeq parseCommandLineOptions(const std::string&, const StringSeq&); + virtual void load(const std::string&); + virtual PropertiesPtr clone(); + +private: + + PropertiesI(); + PropertiesI(StringSeq&); + PropertiesI(int&, char*[]); + friend ICE_API PropertiesPtr createProperties(); + friend ICE_API PropertiesPtr createProperties(StringSeq&); + friend ICE_API PropertiesPtr createProperties(int&, char*[]); + + void parseLine(const std::string&); + + void loadConfig(); + + std::map<std::string, std::string> _properties; +}; + +} + +#endif diff --git a/cpp/src/Ice/Protocol.h b/cpp/src/Ice/Protocol.h index e9bbdf3d185..4d9c879b3b6 100644 --- a/cpp/src/Ice/Protocol.h +++ b/cpp/src/Ice/Protocol.h @@ -1,48 +1,48 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROTOCOL_H
-#define ICE_PROTOCOL_H
-
-#include <Ice/Config.h>
-
-namespace IceInternal
-{
-
-//
-// Size of the Ice protocol header
-//
-// Protocol version (Byte)
-// Encoding version (Byte)
-// Message type (Byte)
-// Message size (Int)
-//
-const ::Ice::Int headerSize = 7;
-
-//
-// The current Ice protocol and encoding version
-//
-const ::Ice::Byte protocolVersion = 0;
-const ::Ice::Byte encodingVersion = 0;
-
-//
-// The Ice protocol message types
-//
-const ::Ice::Byte requestMsg = 0;
-const ::Ice::Byte requestBatchMsg = 1;
-const ::Ice::Byte replyMsg = 2;
-const ::Ice::Byte closeConnectionMsg = 3;
-const ::Ice::Byte compressedRequestMsg = 4;
-const ::Ice::Byte compressedRequestBatchMsg = 5;
-const ::Ice::Byte compressedReplyMsg = 6;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROTOCOL_H +#define ICE_PROTOCOL_H + +#include <Ice/Config.h> + +namespace IceInternal +{ + +// +// Size of the Ice protocol header +// +// Protocol version (Byte) +// Encoding version (Byte) +// Message type (Byte) +// Message size (Int) +// +const ::Ice::Int headerSize = 7; + +// +// The current Ice protocol and encoding version +// +const ::Ice::Byte protocolVersion = 0; +const ::Ice::Byte encodingVersion = 0; + +// +// The Ice protocol message types +// +const ::Ice::Byte requestMsg = 0; +const ::Ice::Byte requestBatchMsg = 1; +const ::Ice::Byte replyMsg = 2; +const ::Ice::Byte closeConnectionMsg = 3; +const ::Ice::Byte compressedRequestMsg = 4; +const ::Ice::Byte compressedRequestBatchMsg = 5; +const ::Ice::Byte compressedReplyMsg = 6; + +} + +#endif diff --git a/cpp/src/Ice/ProxyFactory.h b/cpp/src/Ice/ProxyFactory.h index 0eb5eaef0fe..1154d5e767a 100644 --- a/cpp/src/Ice/ProxyFactory.h +++ b/cpp/src/Ice/ProxyFactory.h @@ -1,49 +1,49 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PROXY_FACTORY_H
-#define ICE_PROXY_FACTORY_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ProxyFactoryF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/ReferenceF.h>
-#include <Ice/ProxyF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class ProxyFactory : public ::IceUtil::Shared
-{
-public:
-
- ::Ice::ObjectPrx stringToProxy(const std::string&) const;
- std::string proxyToString(const ::Ice::ObjectPrx&) const;
-
- ::Ice::ObjectPrx streamToProxy(BasicStream*) const;
- void proxyToStream(const ::Ice::ObjectPrx&, BasicStream*) const;
-
- ::Ice::ObjectPrx referenceToProxy(const ReferencePtr&) const;
-
-private:
-
- ProxyFactory(const InstancePtr&);
- virtual ~ProxyFactory();
- friend class Instance;
-
- InstancePtr _instance;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PROXY_FACTORY_H +#define ICE_PROXY_FACTORY_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ProxyFactoryF.h> +#include <Ice/InstanceF.h> +#include <Ice/ReferenceF.h> +#include <Ice/ProxyF.h> + +namespace IceInternal +{ + +class BasicStream; + +class ProxyFactory : public ::IceUtil::Shared +{ +public: + + ::Ice::ObjectPrx stringToProxy(const std::string&) const; + std::string proxyToString(const ::Ice::ObjectPrx&) const; + + ::Ice::ObjectPrx streamToProxy(BasicStream*) const; + void proxyToStream(const ::Ice::ObjectPrx&, BasicStream*) const; + + ::Ice::ObjectPrx referenceToProxy(const ReferencePtr&) const; + +private: + + ProxyFactory(const InstancePtr&); + virtual ~ProxyFactory(); + friend class Instance; + + InstancePtr _instance; +}; + +} + +#endif diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h index 88a1bde88a5..1c64e87c3d2 100644 --- a/cpp/src/Ice/Reference.h +++ b/cpp/src/Ice/Reference.h @@ -1,96 +1,96 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_REFERENCE_H
-#define ICE_REFERENCE_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/ReferenceF.h>
-#include <Ice/ReferenceFactoryF.h>
-#include <Ice/EndpointF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/RouterF.h>
-#include <Ice/RouterInfoF.h>
-#include <Ice/ObjectAdapterF.h>
-#include <Ice/Identity.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class Reference : public ::IceUtil::Shared
-{
-public:
-
- enum Mode
- {
- ModeTwoway,
- ModeOneway,
- ModeBatchOneway,
- ModeDatagram,
- ModeBatchDatagram,
- ModeLast = ModeBatchDatagram
- };
-
- bool operator==(const Reference&) const;
- bool operator!=(const Reference&) const;
- bool operator<(const Reference&) const;
-
- //
- // Marshal the reference
- //
- void streamWrite(BasicStream*) const;
-
- //
- // Convert the reference to its string form
- //
- std::string toString() const;
-
- //
- // All members are const, because References are immutable.
- //
- const InstancePtr instance;
- const Ice::Identity identity;
- const std::string facet;
- const Mode mode;
- const bool secure;
- const bool compress;
- const std::vector<EndpointPtr> origEndpoints; // Original endpoints.
- const std::vector<EndpointPtr> endpoints; // Actual endpoints, changed by a location forwards.
- const RouterInfoPtr routerInfo; // Null if no router is used.
- const Ice::ObjectAdapterPtr reverseAdapter; // For reverse communications using the adapter's incoming connections.
- const Ice::Int hashValue;
-
- //
- // Get a new reference, based on the existing one, overwriting
- // certain values.
- //
- ReferencePtr changeIdentity(const Ice::Identity&) const;
- ReferencePtr changeFacet(const std::string&) const;
- ReferencePtr changeTimeout(int) const;
- ReferencePtr changeMode(Mode) const;
- ReferencePtr changeSecure(bool) const;
- ReferencePtr changeCompress(bool) const;
- ReferencePtr changeEndpoints(const std::vector<EndpointPtr>&) const;
- ReferencePtr changeRouter(const ::Ice::RouterPrx&) const;
- ReferencePtr changeDefault() const;
-
-private:
-
- Reference(const InstancePtr&, const Ice::Identity&, const std::string&, Mode, bool, bool,
- const std::vector<EndpointPtr>&, const std::vector<EndpointPtr>&,
- const RouterInfoPtr&, const Ice::ObjectAdapterPtr&);
- friend class ReferenceFactory;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_REFERENCE_H +#define ICE_REFERENCE_H + +#include <IceUtil/Shared.h> +#include <Ice/ReferenceF.h> +#include <Ice/ReferenceFactoryF.h> +#include <Ice/EndpointF.h> +#include <Ice/InstanceF.h> +#include <Ice/RouterF.h> +#include <Ice/RouterInfoF.h> +#include <Ice/ObjectAdapterF.h> +#include <Ice/Identity.h> + +namespace IceInternal +{ + +class BasicStream; + +class Reference : public ::IceUtil::Shared +{ +public: + + enum Mode + { + ModeTwoway, + ModeOneway, + ModeBatchOneway, + ModeDatagram, + ModeBatchDatagram, + ModeLast = ModeBatchDatagram + }; + + bool operator==(const Reference&) const; + bool operator!=(const Reference&) const; + bool operator<(const Reference&) const; + + // + // Marshal the reference + // + void streamWrite(BasicStream*) const; + + // + // Convert the reference to its string form + // + std::string toString() const; + + // + // All members are const, because References are immutable. + // + const InstancePtr instance; + const Ice::Identity identity; + const std::string facet; + const Mode mode; + const bool secure; + const bool compress; + const std::vector<EndpointPtr> origEndpoints; // Original endpoints. + const std::vector<EndpointPtr> endpoints; // Actual endpoints, changed by a location forwards. + const RouterInfoPtr routerInfo; // Null if no router is used. + const Ice::ObjectAdapterPtr reverseAdapter; // For reverse communications using the adapter's incoming connections. + const Ice::Int hashValue; + + // + // Get a new reference, based on the existing one, overwriting + // certain values. + // + ReferencePtr changeIdentity(const Ice::Identity&) const; + ReferencePtr changeFacet(const std::string&) const; + ReferencePtr changeTimeout(int) const; + ReferencePtr changeMode(Mode) const; + ReferencePtr changeSecure(bool) const; + ReferencePtr changeCompress(bool) const; + ReferencePtr changeEndpoints(const std::vector<EndpointPtr>&) const; + ReferencePtr changeRouter(const ::Ice::RouterPrx&) const; + ReferencePtr changeDefault() const; + +private: + + Reference(const InstancePtr&, const Ice::Identity&, const std::string&, Mode, bool, bool, + const std::vector<EndpointPtr>&, const std::vector<EndpointPtr>&, + const RouterInfoPtr&, const Ice::ObjectAdapterPtr&); + friend class ReferenceFactory; +}; + +} + +#endif diff --git a/cpp/src/Ice/ReferenceFactory.h b/cpp/src/Ice/ReferenceFactory.h index 84bd3bd17d1..cd7bd723c26 100644 --- a/cpp/src/Ice/ReferenceFactory.h +++ b/cpp/src/Ice/ReferenceFactory.h @@ -1,51 +1,51 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_REFERENCE_FACTORY_H
-#define ICE_REFERENCE_FACTORY_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/ReferenceFactoryF.h>
-#include <Ice/Reference.h> // For Reference::Mode
-#include <set>
-
-namespace IceInternal
-{
-
-class ReferenceFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- ReferencePtr create(const Ice::Identity&, const std::string&, Reference::Mode, bool, bool,
- const std::vector<EndpointPtr>&, const std::vector<EndpointPtr>&,
- const RouterInfoPtr&, const Ice::ObjectAdapterPtr&);
- ReferencePtr create(const std::string&);
- ReferencePtr create(const Ice::Identity&, BasicStream*);
-
- void setDefaultRouter(const ::Ice::RouterPrx&);
- Ice::RouterPrx getDefaultRouter() const;
-
-private:
-
- ReferenceFactory(const InstancePtr&);
- void destroy();
- friend class Instance;
-
- InstancePtr _instance;
- Ice::RouterPrx _defaultRouter;
- std::set<ReferencePtr> _references;
- std::set<ReferencePtr>::iterator _referencesHint;
- int _evict;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_REFERENCE_FACTORY_H +#define ICE_REFERENCE_FACTORY_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/ReferenceFactoryF.h> +#include <Ice/Reference.h> // For Reference::Mode +#include <set> + +namespace IceInternal +{ + +class ReferenceFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + ReferencePtr create(const Ice::Identity&, const std::string&, Reference::Mode, bool, bool, + const std::vector<EndpointPtr>&, const std::vector<EndpointPtr>&, + const RouterInfoPtr&, const Ice::ObjectAdapterPtr&); + ReferencePtr create(const std::string&); + ReferencePtr create(const Ice::Identity&, BasicStream*); + + void setDefaultRouter(const ::Ice::RouterPrx&); + Ice::RouterPrx getDefaultRouter() const; + +private: + + ReferenceFactory(const InstancePtr&); + void destroy(); + friend class Instance; + + InstancePtr _instance; + Ice::RouterPrx _defaultRouter; + std::set<ReferencePtr> _references; + std::set<ReferencePtr>::iterator _referencesHint; + int _evict; +}; + +} + +#endif diff --git a/cpp/src/Ice/ReferenceFactoryF.h b/cpp/src/Ice/ReferenceFactoryF.h index 840723ceb94..ffeaebc5a68 100644 --- a/cpp/src/Ice/ReferenceFactoryF.h +++ b/cpp/src/Ice/ReferenceFactoryF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_REFERENCE_FACTORY_F_H
-#define ICE_REFERENCE_FACTORY_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ReferenceFactory;
-void incRef(ReferenceFactory*);
-void decRef(ReferenceFactory*);
-typedef Handle<ReferenceFactory> ReferenceFactoryPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_REFERENCE_FACTORY_F_H +#define ICE_REFERENCE_FACTORY_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ReferenceFactory; +void incRef(ReferenceFactory*); +void decRef(ReferenceFactory*); +typedef Handle<ReferenceFactory> ReferenceFactoryPtr; + +} + +#endif diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h index b7d3791bea9..15fa489175e 100644 --- a/cpp/src/Ice/RouterInfo.h +++ b/cpp/src/Ice/RouterInfo.h @@ -1,74 +1,74 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ROUTER_INFO_H
-#define ICE_ROUTER_INFO_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/RouterInfoF.h>
-#include <Ice/RouterF.h>
-#include <Ice/ProxyF.h>
-#include <Ice/RoutingTableF.h>
-
-namespace IceInternal
-{
-
-class RouterManager : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- RouterManager();
-
- void destroy();
-
- //
- // Returns router info for a given router. Automatically creates
- // the router info if it doesn't exist yet.
- //
- RouterInfoPtr get(const ::Ice::RouterPrx&);
-
-private:
-
- std::map< ::Ice::RouterPrx, RouterInfoPtr> _table;
- std::map< ::Ice::RouterPrx, RouterInfoPtr>::iterator _tableHint;
-};
-
-class RouterInfo : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- RouterInfo(const ::Ice::RouterPrx&);
-
- bool operator==(const RouterInfo&) const;
- bool operator!=(const RouterInfo&) const;
- bool operator<(const RouterInfo&) const;
-
- ::Ice::RouterPrx getRouter();
- ::Ice::ObjectPrx getClientProxy();
- void setClientProxy(const ::Ice::ObjectPrx&);
- ::Ice::ObjectPrx getServerProxy();
- void setServerProxy(const ::Ice::ObjectPrx&);
- void addProxy(const ::Ice::ObjectPrx&);
- void setAdapter(const ::Ice::ObjectAdapterPtr&);
- ::Ice::ObjectAdapterPtr getAdapter();
-
-private:
-
- ::Ice::RouterPrx _router;
- ::Ice::ObjectPrx _clientProxy;
- ::Ice::ObjectPrx _serverProxy;
- RoutingTablePtr _routingTable;
- ::Ice::ObjectAdapterPtr _adapter;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ROUTER_INFO_H +#define ICE_ROUTER_INFO_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/RouterInfoF.h> +#include <Ice/RouterF.h> +#include <Ice/ProxyF.h> +#include <Ice/RoutingTableF.h> + +namespace IceInternal +{ + +class RouterManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + RouterManager(); + + void destroy(); + + // + // Returns router info for a given router. Automatically creates + // the router info if it doesn't exist yet. + // + RouterInfoPtr get(const ::Ice::RouterPrx&); + +private: + + std::map< ::Ice::RouterPrx, RouterInfoPtr> _table; + std::map< ::Ice::RouterPrx, RouterInfoPtr>::iterator _tableHint; +}; + +class RouterInfo : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + RouterInfo(const ::Ice::RouterPrx&); + + bool operator==(const RouterInfo&) const; + bool operator!=(const RouterInfo&) const; + bool operator<(const RouterInfo&) const; + + ::Ice::RouterPrx getRouter(); + ::Ice::ObjectPrx getClientProxy(); + void setClientProxy(const ::Ice::ObjectPrx&); + ::Ice::ObjectPrx getServerProxy(); + void setServerProxy(const ::Ice::ObjectPrx&); + void addProxy(const ::Ice::ObjectPrx&); + void setAdapter(const ::Ice::ObjectAdapterPtr&); + ::Ice::ObjectAdapterPtr getAdapter(); + +private: + + ::Ice::RouterPrx _router; + ::Ice::ObjectPrx _clientProxy; + ::Ice::ObjectPrx _serverProxy; + RoutingTablePtr _routingTable; + ::Ice::ObjectAdapterPtr _adapter; +}; + +} + +#endif diff --git a/cpp/src/Ice/RouterInfoF.h b/cpp/src/Ice/RouterInfoF.h index 1db2e9bb606..72afbc70e7f 100644 --- a/cpp/src/Ice/RouterInfoF.h +++ b/cpp/src/Ice/RouterInfoF.h @@ -1,31 +1,31 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_ROUTER_INFO_F_H
-#define ICE_ROUTER_INFO_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class RouterManager;
-void incRef(RouterManager*);
-void decRef(RouterManager*);
-typedef Handle<RouterManager> RouterManagerPtr;
-
-class RouterInfo;
-void incRef(RouterInfo*);
-void decRef(RouterInfo*);
-typedef Handle<RouterInfo> RouterInfoPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ROUTER_INFO_F_H +#define ICE_ROUTER_INFO_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class RouterManager; +void incRef(RouterManager*); +void decRef(RouterManager*); +typedef Handle<RouterManager> RouterManagerPtr; + +class RouterInfo; +void incRef(RouterInfo*); +void decRef(RouterInfo*); +typedef Handle<RouterInfo> RouterInfoPtr; + +} + +#endif diff --git a/cpp/src/Ice/SysLoggerI.h b/cpp/src/Ice/SysLoggerI.h index f7d14c324e2..8ddde95cf7e 100644 --- a/cpp/src/Ice/SysLoggerI.h +++ b/cpp/src/Ice/SysLoggerI.h @@ -1,31 +1,31 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SYS_LOGGER_I_H
-#define ICE_SYS_LOGGER_I_H
-
-#include <IceUtil/Mutex.h>
-#include <Ice/Logger.h>
-
-namespace Ice
-{
-
-class SysLoggerI : public Logger, public ::IceUtil::Mutex
-{
-public:
-
- virtual void trace(const std::string&, const std::string&);
- virtual void warning(const std::string&);
- virtual void error(const std::string&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SYS_LOGGER_I_H +#define ICE_SYS_LOGGER_I_H + +#include <IceUtil/Mutex.h> +#include <Ice/Logger.h> + +namespace Ice +{ + +class SysLoggerI : public Logger, public ::IceUtil::Mutex +{ +public: + + virtual void trace(const std::string&, const std::string&); + virtual void warning(const std::string&); + virtual void error(const std::string&); +}; + +} + +#endif diff --git a/cpp/src/Ice/TcpAcceptor.h b/cpp/src/Ice/TcpAcceptor.h index 2cb462f7864..e98a222f401 100644 --- a/cpp/src/Ice/TcpAcceptor.h +++ b/cpp/src/Ice/TcpAcceptor.h @@ -1,58 +1,58 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TCP_ACCEPTOR_H
-#define ICE_TCP_ACCEPTOR_H
-
-#include <Ice/TransceiverF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/Acceptor.h>
-
-#ifndef _WIN32
-# include <netinet/in.h> // For struct sockaddr_in
-#endif
-
-namespace IceInternal
-{
-
-class TcpEndpoint;
-
-class TcpAcceptor : public Acceptor
-{
-public:
-
- virtual SOCKET fd();
- virtual void close();
- virtual void listen();
- virtual TransceiverPtr accept(int);
- virtual std::string toString() const;
-
- bool equivalent(const std::string&, int) const;
- int effectivePort();
-
-private:
-
- TcpAcceptor(const InstancePtr&, const std::string&, int);
- virtual ~TcpAcceptor();
- friend class TcpEndpoint;
-
- InstancePtr _instance;
- TraceLevelsPtr _traceLevels;
- ::Ice::LoggerPtr _logger;
- SOCKET _fd;
- int _backlog;
- struct sockaddr_in _addr;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TCP_ACCEPTOR_H +#define ICE_TCP_ACCEPTOR_H + +#include <Ice/TransceiverF.h> +#include <Ice/InstanceF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/LoggerF.h> +#include <Ice/Acceptor.h> + +#ifndef _WIN32 +# include <netinet/in.h> // For struct sockaddr_in +#endif + +namespace IceInternal +{ + +class TcpEndpoint; + +class TcpAcceptor : public Acceptor +{ +public: + + virtual SOCKET fd(); + virtual void close(); + virtual void listen(); + virtual TransceiverPtr accept(int); + virtual std::string toString() const; + + bool equivalent(const std::string&, int) const; + int effectivePort(); + +private: + + TcpAcceptor(const InstancePtr&, const std::string&, int); + virtual ~TcpAcceptor(); + friend class TcpEndpoint; + + InstancePtr _instance; + TraceLevelsPtr _traceLevels; + ::Ice::LoggerPtr _logger; + SOCKET _fd; + int _backlog; + struct sockaddr_in _addr; +}; + +} + +#endif diff --git a/cpp/src/Ice/TcpConnector.h b/cpp/src/Ice/TcpConnector.h index 79dfea97455..e554d7210b5 100644 --- a/cpp/src/Ice/TcpConnector.h +++ b/cpp/src/Ice/TcpConnector.h @@ -1,50 +1,50 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TCP_CONNECTOR_H
-#define ICE_TCP_CONNECTOR_H
-
-#include <Ice/TransceiverF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/Connector.h>
-
-#ifndef _WIN32
-# include <netinet/in.h> // For struct sockaddr_in
-#endif
-
-namespace IceInternal
-{
-
-class TcpEndpoint;
-
-class TcpConnector : public Connector
-{
-public:
-
- virtual TransceiverPtr connect(int);
- virtual std::string toString() const;
-
-private:
-
- TcpConnector(const InstancePtr&, const std::string&, int);
- virtual ~TcpConnector();
- friend class TcpEndpoint;
-
- InstancePtr _instance;
- TraceLevelsPtr _traceLevels;
- ::Ice::LoggerPtr _logger;
- struct sockaddr_in _addr;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TCP_CONNECTOR_H +#define ICE_TCP_CONNECTOR_H + +#include <Ice/TransceiverF.h> +#include <Ice/InstanceF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/LoggerF.h> +#include <Ice/Connector.h> + +#ifndef _WIN32 +# include <netinet/in.h> // For struct sockaddr_in +#endif + +namespace IceInternal +{ + +class TcpEndpoint; + +class TcpConnector : public Connector +{ +public: + + virtual TransceiverPtr connect(int); + virtual std::string toString() const; + +private: + + TcpConnector(const InstancePtr&, const std::string&, int); + virtual ~TcpConnector(); + friend class TcpEndpoint; + + InstancePtr _instance; + TraceLevelsPtr _traceLevels; + ::Ice::LoggerPtr _logger; + struct sockaddr_in _addr; +}; + +} + +#endif diff --git a/cpp/src/Ice/TcpEndpoint.h b/cpp/src/Ice/TcpEndpoint.h index 9ef58fe6eaa..55c7b371132 100644 --- a/cpp/src/Ice/TcpEndpoint.h +++ b/cpp/src/Ice/TcpEndpoint.h @@ -1,82 +1,82 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TCP_ENDPOINT_H
-#define ICE_TCP_ENDPOINT_H
-
-#include <Ice/Endpoint.h>
-#include <Ice/EndpointFactory.h>
-
-namespace IceInternal
-{
-
-const ::Ice::Short TcpEndpointType = 1;
-
-class TcpEndpoint : public Endpoint
-{
-public:
-
- TcpEndpoint(const InstancePtr&, const std::string&, ::Ice::Int, ::Ice::Int);
- TcpEndpoint(const InstancePtr&, const std::string&);
- TcpEndpoint(BasicStream*);
-
- virtual void streamWrite(BasicStream*) const;
- virtual std::string toString() const;
- virtual ::Ice::Short type() const;
- virtual ::Ice::Int timeout() const;
- virtual EndpointPtr timeout(::Ice::Int) const;
- virtual bool datagram() const;
- virtual bool secure() const;
- virtual bool unknown() const;
- virtual TransceiverPtr clientTransceiver() const;
- virtual TransceiverPtr serverTransceiver(EndpointPtr&) const;
- virtual ConnectorPtr connector() const;
- virtual AcceptorPtr acceptor(EndpointPtr&) const;
- virtual bool equivalent(const TransceiverPtr&) const;
- virtual bool equivalent(const AcceptorPtr&) const;
-
- virtual bool operator==(const Endpoint&) const;
- virtual bool operator!=(const Endpoint&) const;
- virtual bool operator<(const Endpoint&) const;
-
-private:
-
- //
- // All members are const, because endpoints are immutable.
- //
- const InstancePtr _instance;
- const std::string _host;
- const ::Ice::Int _port;
- const ::Ice::Int _timeout;
-};
-
-class TcpEndpointFactory : public EndpointFactory
-{
-public:
-
- virtual ~TcpEndpointFactory();
-
- virtual ::Ice::Short type() const;
- virtual const ::std::string& protocol() const;
- virtual EndpointPtr create(const std::string&) const;
- virtual EndpointPtr read(BasicStream*) const;
- virtual void destroy();
-
-private:
-
- TcpEndpointFactory(const InstancePtr&);
- friend class Instance;
-
- InstancePtr _instance;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TCP_ENDPOINT_H +#define ICE_TCP_ENDPOINT_H + +#include <Ice/Endpoint.h> +#include <Ice/EndpointFactory.h> + +namespace IceInternal +{ + +const ::Ice::Short TcpEndpointType = 1; + +class TcpEndpoint : public Endpoint +{ +public: + + TcpEndpoint(const InstancePtr&, const std::string&, ::Ice::Int, ::Ice::Int); + TcpEndpoint(const InstancePtr&, const std::string&); + TcpEndpoint(BasicStream*); + + virtual void streamWrite(BasicStream*) const; + virtual std::string toString() const; + virtual ::Ice::Short type() const; + virtual ::Ice::Int timeout() const; + virtual EndpointPtr timeout(::Ice::Int) const; + virtual bool datagram() const; + virtual bool secure() const; + virtual bool unknown() const; + virtual TransceiverPtr clientTransceiver() const; + virtual TransceiverPtr serverTransceiver(EndpointPtr&) const; + virtual ConnectorPtr connector() const; + virtual AcceptorPtr acceptor(EndpointPtr&) const; + virtual bool equivalent(const TransceiverPtr&) const; + virtual bool equivalent(const AcceptorPtr&) const; + + virtual bool operator==(const Endpoint&) const; + virtual bool operator!=(const Endpoint&) const; + virtual bool operator<(const Endpoint&) const; + +private: + + // + // All members are const, because endpoints are immutable. + // + const InstancePtr _instance; + const std::string _host; + const ::Ice::Int _port; + const ::Ice::Int _timeout; +}; + +class TcpEndpointFactory : public EndpointFactory +{ +public: + + virtual ~TcpEndpointFactory(); + + virtual ::Ice::Short type() const; + virtual const ::std::string& protocol() const; + virtual EndpointPtr create(const std::string&) const; + virtual EndpointPtr read(BasicStream*) const; + virtual void destroy(); + +private: + + TcpEndpointFactory(const InstancePtr&); + friend class Instance; + + InstancePtr _instance; +}; + +} + +#endif diff --git a/cpp/src/Ice/TcpTransceiver.h b/cpp/src/Ice/TcpTransceiver.h index c3daa2fdb37..9809f68a60b 100644 --- a/cpp/src/Ice/TcpTransceiver.h +++ b/cpp/src/Ice/TcpTransceiver.h @@ -1,53 +1,53 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TCP_TRANSCEIVER_H
-#define ICE_TCP_TRANSCEIVER_H
-
-#include <Ice/InstanceF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/Transceiver.h>
-
-namespace IceInternal
-{
-
-class TcpConnector;
-class TcpAcceptor;
-
-class TcpTransceiver : public Transceiver
-{
-public:
-
- virtual SOCKET fd();
- virtual void close();
- virtual void shutdown();
- virtual void write(Buffer&, int);
- virtual void read(Buffer&, int);
- virtual std::string toString() const;
-
-private:
-
- TcpTransceiver(const InstancePtr&, SOCKET);
- virtual ~TcpTransceiver();
- friend class TcpConnector;
- friend class TcpAcceptor;
-
- InstancePtr _instance;
- TraceLevelsPtr _traceLevels;
- ::Ice::LoggerPtr _logger;
- SOCKET _fd;
- fd_set _rFdSet;
- fd_set _wFdSet;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TCP_TRANSCEIVER_H +#define ICE_TCP_TRANSCEIVER_H + +#include <Ice/InstanceF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/LoggerF.h> +#include <Ice/Transceiver.h> + +namespace IceInternal +{ + +class TcpConnector; +class TcpAcceptor; + +class TcpTransceiver : public Transceiver +{ +public: + + virtual SOCKET fd(); + virtual void close(); + virtual void shutdown(); + virtual void write(Buffer&, int); + virtual void read(Buffer&, int); + virtual std::string toString() const; + +private: + + TcpTransceiver(const InstancePtr&, SOCKET); + virtual ~TcpTransceiver(); + friend class TcpConnector; + friend class TcpAcceptor; + + InstancePtr _instance; + TraceLevelsPtr _traceLevels; + ::Ice::LoggerPtr _logger; + SOCKET _fd; + fd_set _rFdSet; + fd_set _wFdSet; +}; + +} + +#endif diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h index 9343ab54dd5..dfdb3aa7d53 100644 --- a/cpp/src/Ice/ThreadPool.h +++ b/cpp/src/Ice/ThreadPool.h @@ -1,93 +1,93 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_THREAD_POOL_H
-#define ICE_THREAD_POOL_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <IceUtil/Monitor.h>
-#include <IceUtil/Thread.h>
-
-#include <Ice/ThreadPoolF.h>
-#include <Ice/InstanceF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/EventHandlerF.h>
-#include <list>
-
-#ifndef _WIN32
-# define SOCKET int
-#endif
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-class ThreadPool : public ::IceUtil::Shared, public IceUtil::Monitor<IceUtil::Mutex>
-{
-public:
-
- void _register(SOCKET, const EventHandlerPtr&);
- void unregister(SOCKET);
- void promoteFollower();
- void initiateShutdown(); // Signal-safe shutdown initiation.
- void waitUntilFinished();
- void joinWithAllThreads();
-
-private:
-
- ThreadPool(const InstancePtr&, bool);
- virtual ~ThreadPool();
- void destroy();
- friend class Instance;
-
- bool clearInterrupt();
- void setInterrupt(char);
-
- void run();
- void read(const EventHandlerPtr&);
-
- InstancePtr _instance;
- bool _destroyed;
- SOCKET _maxFd;
- SOCKET _minFd;
- SOCKET _lastFd;
- SOCKET _fdIntrRead;
- SOCKET _fdIntrWrite;
- fd_set _fdSet;
- std::list<std::pair<SOCKET, EventHandlerPtr> > _changes; // Event handler set for addition; null for removal.
- std::map<SOCKET, EventHandlerPtr> _handlerMap;
- int _handlers;
- int _timeout;
- ::IceUtil::Mutex _threadMutex;
- bool _multipleThreads;
-
- class EventHandlerThread : public ::IceUtil::Thread
- {
- public:
-
- EventHandlerThread(const ThreadPoolPtr&);
- virtual void run();
-
- private:
-
- ThreadPoolPtr _pool;
- };
- friend class EventHandlerThread;
-
- std::vector<IceUtil::ThreadControl> _threads; // Control for all threads, running or not.
- int _threadNum; // Number of running threads.
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_THREAD_POOL_H +#define ICE_THREAD_POOL_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <IceUtil/Monitor.h> +#include <IceUtil/Thread.h> + +#include <Ice/ThreadPoolF.h> +#include <Ice/InstanceF.h> +#include <Ice/LoggerF.h> +#include <Ice/PropertiesF.h> +#include <Ice/EventHandlerF.h> +#include <list> + +#ifndef _WIN32 +# define SOCKET int +#endif + +namespace IceInternal +{ + +class BasicStream; + +class ThreadPool : public ::IceUtil::Shared, public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + void _register(SOCKET, const EventHandlerPtr&); + void unregister(SOCKET); + void promoteFollower(); + void initiateShutdown(); // Signal-safe shutdown initiation. + void waitUntilFinished(); + void joinWithAllThreads(); + +private: + + ThreadPool(const InstancePtr&, bool); + virtual ~ThreadPool(); + void destroy(); + friend class Instance; + + bool clearInterrupt(); + void setInterrupt(char); + + void run(); + void read(const EventHandlerPtr&); + + InstancePtr _instance; + bool _destroyed; + SOCKET _maxFd; + SOCKET _minFd; + SOCKET _lastFd; + SOCKET _fdIntrRead; + SOCKET _fdIntrWrite; + fd_set _fdSet; + std::list<std::pair<SOCKET, EventHandlerPtr> > _changes; // Event handler set for addition; null for removal. + std::map<SOCKET, EventHandlerPtr> _handlerMap; + int _handlers; + int _timeout; + ::IceUtil::Mutex _threadMutex; + bool _multipleThreads; + + class EventHandlerThread : public ::IceUtil::Thread + { + public: + + EventHandlerThread(const ThreadPoolPtr&); + virtual void run(); + + private: + + ThreadPoolPtr _pool; + }; + friend class EventHandlerThread; + + std::vector<IceUtil::ThreadControl> _threads; // Control for all threads, running or not. + int _threadNum; // Number of running threads. +}; + +} + +#endif diff --git a/cpp/src/Ice/ThreadPoolF.h b/cpp/src/Ice/ThreadPoolF.h index 18628f56397..44332d6c413 100644 --- a/cpp/src/Ice/ThreadPoolF.h +++ b/cpp/src/Ice/ThreadPoolF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_THREAD_POOL_F_H
-#define ICE_THREAD_POOL_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class ThreadPool;
-void incRef(ThreadPool*);
-void decRef(ThreadPool*);
-typedef Handle<ThreadPool> ThreadPoolPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_THREAD_POOL_F_H +#define ICE_THREAD_POOL_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class ThreadPool; +void incRef(ThreadPool*); +void decRef(ThreadPool*); +typedef Handle<ThreadPool> ThreadPoolPtr; + +} + +#endif diff --git a/cpp/src/Ice/TraceLevels.h b/cpp/src/Ice/TraceLevels.h index 80217412055..ea2cec28fb9 100644 --- a/cpp/src/Ice/TraceLevels.h +++ b/cpp/src/Ice/TraceLevels.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TRACE_LEVELS_H
-#define ICE_TRACE_LEVELS_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/PropertiesF.h>
-
-namespace IceInternal
-{
-
-class TraceLevels : public ::IceUtil::Shared
-{
-public:
-
- TraceLevels(const ::Ice::PropertiesPtr&);
-
- const int network;
- const char* networkCat;
-
- const int protocol;
- const char* protocolCat;
-
- const int retry;
- const char* retryCat;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TRACE_LEVELS_H +#define ICE_TRACE_LEVELS_H + +#include <IceUtil/Shared.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/PropertiesF.h> + +namespace IceInternal +{ + +class TraceLevels : public ::IceUtil::Shared +{ +public: + + TraceLevels(const ::Ice::PropertiesPtr&); + + const int network; + const char* networkCat; + + const int protocol; + const char* protocolCat; + + const int retry; + const char* retryCat; +}; + +} + +#endif diff --git a/cpp/src/Ice/TraceLevelsF.h b/cpp/src/Ice/TraceLevelsF.h index 16648060987..8b6e37218b6 100644 --- a/cpp/src/Ice/TraceLevelsF.h +++ b/cpp/src/Ice/TraceLevelsF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TRACE_LEVELS_F_H
-#define ICE_TRACE_LEVELS_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class TraceLevels;
-void incRef(TraceLevels*);
-void decRef(TraceLevels*);
-typedef Handle<TraceLevels> TraceLevelsPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TRACE_LEVELS_F_H +#define ICE_TRACE_LEVELS_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class TraceLevels; +void incRef(TraceLevels*); +void decRef(TraceLevels*); +typedef Handle<TraceLevels> TraceLevelsPtr; + +} + +#endif diff --git a/cpp/src/Ice/TraceUtil.h b/cpp/src/Ice/TraceUtil.h index d76da5378ac..8841561ad82 100644 --- a/cpp/src/Ice/TraceUtil.h +++ b/cpp/src/Ice/TraceUtil.h @@ -1,29 +1,29 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TRACE_UTIL_H
-#define ICE_TRACE_UTIL_H
-
-#include <Ice/LoggerF.h>
-#include <Ice/TraceLevelsF.h>
-
-namespace IceInternal
-{
-
-class BasicStream;
-
-void traceHeader(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&);
-void traceRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&);
-void traceBatchRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&);
-void traceReply(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TRACE_UTIL_H +#define ICE_TRACE_UTIL_H + +#include <Ice/LoggerF.h> +#include <Ice/TraceLevelsF.h> + +namespace IceInternal +{ + +class BasicStream; + +void traceHeader(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); +void traceRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); +void traceBatchRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); +void traceReply(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); + +} + +#endif diff --git a/cpp/src/Ice/Transceiver.h b/cpp/src/Ice/Transceiver.h index 2238527f8b1..244e2743415 100644 --- a/cpp/src/Ice/Transceiver.h +++ b/cpp/src/Ice/Transceiver.h @@ -1,40 +1,40 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TRANSCEIVER_H
-#define ICE_TRANSCEIVER_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/TransceiverF.h>
-
-#ifndef _WIN32
-# define SOCKET int
-#endif
-
-namespace IceInternal
-{
-
-class Buffer;
-
-class ICE_PROTOCOL_API Transceiver : public ::IceUtil::Shared
-{
-public:
-
- virtual SOCKET fd() = 0;
- virtual void close() = 0;
- virtual void shutdown() = 0;
- virtual void write(Buffer&, int) = 0;
- virtual void read(Buffer&, int) = 0;
- virtual std::string toString() const = 0;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TRANSCEIVER_H +#define ICE_TRANSCEIVER_H + +#include <IceUtil/Shared.h> +#include <Ice/TransceiverF.h> + +#ifndef _WIN32 +# define SOCKET int +#endif + +namespace IceInternal +{ + +class Buffer; + +class ICE_PROTOCOL_API Transceiver : public ::IceUtil::Shared +{ +public: + + virtual SOCKET fd() = 0; + virtual void close() = 0; + virtual void shutdown() = 0; + virtual void write(Buffer&, int) = 0; + virtual void read(Buffer&, int) = 0; + virtual std::string toString() const = 0; +}; + +} + +#endif diff --git a/cpp/src/Ice/TransceiverF.h b/cpp/src/Ice/TransceiverF.h index 45b1bde641b..80f3293f0e2 100644 --- a/cpp/src/Ice/TransceiverF.h +++ b/cpp/src/Ice/TransceiverF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_TRANSCEIVER_F_H
-#define ICE_TRANSCEIVER_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class Transceiver;
-ICE_PROTOCOL_API void incRef(Transceiver*);
-ICE_PROTOCOL_API void decRef(Transceiver*);
-typedef Handle<Transceiver> TransceiverPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_TRANSCEIVER_F_H +#define ICE_TRANSCEIVER_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class Transceiver; +ICE_PROTOCOL_API void incRef(Transceiver*); +ICE_PROTOCOL_API void decRef(Transceiver*); +typedef Handle<Transceiver> TransceiverPtr; + +} + +#endif diff --git a/cpp/src/Ice/UdpEndpoint.h b/cpp/src/Ice/UdpEndpoint.h index fe0d3233951..321b9214f9e 100644 --- a/cpp/src/Ice/UdpEndpoint.h +++ b/cpp/src/Ice/UdpEndpoint.h @@ -1,82 +1,82 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UDP_ENDPOINT_H
-#define ICE_UDP_ENDPOINT_H
-
-#include <Ice/Endpoint.h>
-#include <Ice/EndpointFactory.h>
-
-namespace IceInternal
-{
-
-const ::Ice::Short UdpEndpointType = 3;
-
-class UdpEndpoint : public Endpoint
-{
-public:
-
- UdpEndpoint(const InstancePtr&, const std::string&, ::Ice::Int);
- UdpEndpoint(const InstancePtr&, const std::string&);
- UdpEndpoint(BasicStream*);
-
- virtual void streamWrite(BasicStream*) const;
- virtual std::string toString() const;
- virtual ::Ice::Short type() const;
- virtual ::Ice::Int timeout() const;
- virtual EndpointPtr timeout(::Ice::Int) const;
- virtual bool datagram() const;
- virtual bool secure() const;
- virtual bool unknown() const;
- virtual TransceiverPtr clientTransceiver() const;
- virtual TransceiverPtr serverTransceiver(EndpointPtr&) const;
- virtual ConnectorPtr connector() const;
- virtual AcceptorPtr acceptor(EndpointPtr&) const;
- virtual bool equivalent(const TransceiverPtr&) const;
- virtual bool equivalent(const AcceptorPtr&) const;
-
- virtual bool operator==(const Endpoint&) const;
- virtual bool operator!=(const Endpoint&) const;
- virtual bool operator<(const Endpoint&) const;
-
-private:
-
- //
- // All members are const, because endpoints are immutable.
- //
- const InstancePtr _instance;
- const std::string _host;
- const ::Ice::Int _port;
- const bool _connect;
-};
-
-class UdpEndpointFactory : public EndpointFactory
-{
-public:
-
- virtual ~UdpEndpointFactory();
-
- virtual ::Ice::Short type() const;
- virtual const ::std::string& protocol() const;
- virtual EndpointPtr create(const std::string&) const;
- virtual EndpointPtr read(BasicStream*) const;
- virtual void destroy();
-
-private:
-
- UdpEndpointFactory(const InstancePtr&);
- friend class Instance;
-
- InstancePtr _instance;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UDP_ENDPOINT_H +#define ICE_UDP_ENDPOINT_H + +#include <Ice/Endpoint.h> +#include <Ice/EndpointFactory.h> + +namespace IceInternal +{ + +const ::Ice::Short UdpEndpointType = 3; + +class UdpEndpoint : public Endpoint +{ +public: + + UdpEndpoint(const InstancePtr&, const std::string&, ::Ice::Int); + UdpEndpoint(const InstancePtr&, const std::string&); + UdpEndpoint(BasicStream*); + + virtual void streamWrite(BasicStream*) const; + virtual std::string toString() const; + virtual ::Ice::Short type() const; + virtual ::Ice::Int timeout() const; + virtual EndpointPtr timeout(::Ice::Int) const; + virtual bool datagram() const; + virtual bool secure() const; + virtual bool unknown() const; + virtual TransceiverPtr clientTransceiver() const; + virtual TransceiverPtr serverTransceiver(EndpointPtr&) const; + virtual ConnectorPtr connector() const; + virtual AcceptorPtr acceptor(EndpointPtr&) const; + virtual bool equivalent(const TransceiverPtr&) const; + virtual bool equivalent(const AcceptorPtr&) const; + + virtual bool operator==(const Endpoint&) const; + virtual bool operator!=(const Endpoint&) const; + virtual bool operator<(const Endpoint&) const; + +private: + + // + // All members are const, because endpoints are immutable. + // + const InstancePtr _instance; + const std::string _host; + const ::Ice::Int _port; + const bool _connect; +}; + +class UdpEndpointFactory : public EndpointFactory +{ +public: + + virtual ~UdpEndpointFactory(); + + virtual ::Ice::Short type() const; + virtual const ::std::string& protocol() const; + virtual EndpointPtr create(const std::string&) const; + virtual EndpointPtr read(BasicStream*) const; + virtual void destroy(); + +private: + + UdpEndpointFactory(const InstancePtr&); + friend class Instance; + + InstancePtr _instance; +}; + +} + +#endif diff --git a/cpp/src/Ice/UdpTransceiver.h b/cpp/src/Ice/UdpTransceiver.h index 215f8a6bc74..5a979dc9ac1 100644 --- a/cpp/src/Ice/UdpTransceiver.h +++ b/cpp/src/Ice/UdpTransceiver.h @@ -1,69 +1,69 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UDP_TRANSCEIVER_H
-#define ICE_UDP_TRANSCEIVER_H
-
-#include <Ice/InstanceF.h>
-#include <Ice/TraceLevelsF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/Transceiver.h>
-
-#ifndef _WIN32
-# include <netinet/in.h> // For struct sockaddr_in
-#endif
-
-namespace IceInternal
-{
-
-class UdpEndpoint;
-
-class SUdpTransceiver;
-
-class UdpTransceiver : public Transceiver
-{
-public:
-
- virtual SOCKET fd();
- virtual void close();
- virtual void shutdown();
- virtual void write(Buffer&, int);
- virtual void read(Buffer&, int);
- virtual std::string toString() const;
-
- bool equivalent(const std::string&, int) const;
- int effectivePort();
- void setProtocolName(const std::string&);
-
-private:
-
- UdpTransceiver(const InstancePtr&, const std::string&, int, const std::string& protocolName = "udp");
- UdpTransceiver(const InstancePtr&, const std::string&, int, bool, const std::string& protocolName = "udp");
- virtual ~UdpTransceiver();
-
- friend class UdpEndpoint;
-// friend class SUdpEndpoint; // TODO: Remove as soon as SUdpEndpoint uses SUdpTransceiver.
-// friend class SUdpTransceiver;
-
- InstancePtr _instance;
- TraceLevelsPtr _traceLevels;
- ::Ice::LoggerPtr _logger;
- bool _incoming;
- bool _connect;
- SOCKET _fd;
- struct sockaddr_in _addr;
- fd_set _rFdSet;
- fd_set _wFdSet;
- std::string _protocolName;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UDP_TRANSCEIVER_H +#define ICE_UDP_TRANSCEIVER_H + +#include <Ice/InstanceF.h> +#include <Ice/TraceLevelsF.h> +#include <Ice/LoggerF.h> +#include <Ice/Transceiver.h> + +#ifndef _WIN32 +# include <netinet/in.h> // For struct sockaddr_in +#endif + +namespace IceInternal +{ + +class UdpEndpoint; + +class SUdpTransceiver; + +class UdpTransceiver : public Transceiver +{ +public: + + virtual SOCKET fd(); + virtual void close(); + virtual void shutdown(); + virtual void write(Buffer&, int); + virtual void read(Buffer&, int); + virtual std::string toString() const; + + bool equivalent(const std::string&, int) const; + int effectivePort(); + void setProtocolName(const std::string&); + +private: + + UdpTransceiver(const InstancePtr&, const std::string&, int, const std::string& protocolName = "udp"); + UdpTransceiver(const InstancePtr&, const std::string&, int, bool, const std::string& protocolName = "udp"); + virtual ~UdpTransceiver(); + + friend class UdpEndpoint; +// friend class SUdpEndpoint; // TODO: Remove as soon as SUdpEndpoint uses SUdpTransceiver. +// friend class SUdpTransceiver; + + InstancePtr _instance; + TraceLevelsPtr _traceLevels; + ::Ice::LoggerPtr _logger; + bool _incoming; + bool _connect; + SOCKET _fd; + struct sockaddr_in _addr; + fd_set _rFdSet; + fd_set _wFdSet; + std::string _protocolName; +}; + +} + +#endif diff --git a/cpp/src/Ice/UnknownEndpoint.h b/cpp/src/Ice/UnknownEndpoint.h index ed48fde8fb6..17ea13a7320 100644 --- a/cpp/src/Ice/UnknownEndpoint.h +++ b/cpp/src/Ice/UnknownEndpoint.h @@ -1,59 +1,59 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_UNKNOWN_ENDPOINT_H
-#define ICE_UNKNOWN_ENDPOINT_H
-
-#include <Ice/Endpoint.h>
-#include <Ice/EndpointFactory.h>
-
-namespace IceInternal
-{
-
-const ::Ice::Short UnknownEndpointType = 0;
-
-class UnknownEndpoint : public Endpoint
-{
-public:
-
- UnknownEndpoint(::Ice::Short, BasicStream*);
-
- virtual void streamWrite(BasicStream*) const;
- virtual std::string toString() const;
- virtual ::Ice::Short type() const;
- virtual ::Ice::Int timeout() const;
- virtual EndpointPtr timeout(::Ice::Int) const;
- virtual bool datagram() const;
- virtual bool secure() const;
- virtual bool unknown() const;
- virtual TransceiverPtr clientTransceiver() const;
- virtual TransceiverPtr serverTransceiver(EndpointPtr&) const;
- virtual ConnectorPtr connector() const;
- virtual AcceptorPtr acceptor(EndpointPtr&) const;
- virtual bool equivalent(const TransceiverPtr&) const;
- virtual bool equivalent(const AcceptorPtr&) const;
-
- virtual bool operator==(const Endpoint&) const;
- virtual bool operator!=(const Endpoint&) const;
- virtual bool operator<(const Endpoint&) const;
-
-private:
-
- //
- // All members are const, because endpoints are immutable.
- //
- const InstancePtr _instance;
- ::Ice::Short _type;
- const std::vector< ::Ice::Byte> _rawBytes;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_UNKNOWN_ENDPOINT_H +#define ICE_UNKNOWN_ENDPOINT_H + +#include <Ice/Endpoint.h> +#include <Ice/EndpointFactory.h> + +namespace IceInternal +{ + +const ::Ice::Short UnknownEndpointType = 0; + +class UnknownEndpoint : public Endpoint +{ +public: + + UnknownEndpoint(::Ice::Short, BasicStream*); + + virtual void streamWrite(BasicStream*) const; + virtual std::string toString() const; + virtual ::Ice::Short type() const; + virtual ::Ice::Int timeout() const; + virtual EndpointPtr timeout(::Ice::Int) const; + virtual bool datagram() const; + virtual bool secure() const; + virtual bool unknown() const; + virtual TransceiverPtr clientTransceiver() const; + virtual TransceiverPtr serverTransceiver(EndpointPtr&) const; + virtual ConnectorPtr connector() const; + virtual AcceptorPtr acceptor(EndpointPtr&) const; + virtual bool equivalent(const TransceiverPtr&) const; + virtual bool equivalent(const AcceptorPtr&) const; + + virtual bool operator==(const Endpoint&) const; + virtual bool operator!=(const Endpoint&) const; + virtual bool operator<(const Endpoint&) const; + +private: + + // + // All members are const, because endpoints are immutable. + // + const InstancePtr _instance; + ::Ice::Short _type; + const std::vector< ::Ice::Byte> _rawBytes; +}; + +} + +#endif diff --git a/cpp/src/Ice/UserExceptionFactoryManager.h b/cpp/src/Ice/UserExceptionFactoryManager.h index a213272df31..8c59c847549 100644 --- a/cpp/src/Ice/UserExceptionFactoryManager.h +++ b/cpp/src/Ice/UserExceptionFactoryManager.h @@ -1,42 +1,42 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_USER_EXCEPTION_FACTORY_MANAGER_H
-#define ICE_USER_EXCEPTION_FACTORY_MANAGER_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Mutex.h>
-#include <Ice/UserExceptionFactoryManagerF.h>
-#include <Ice/UserExceptionFactoryF.h>
-
-namespace IceInternal
-{
-
-class UserExceptionFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex
-{
-public:
-
- void add(const ::Ice::UserExceptionFactoryPtr&, const std::string&);
- void remove(const std::string&);
- ::Ice::UserExceptionFactoryPtr find(const std::string&);
-
-private:
-
- UserExceptionFactoryManager();
- void destroy();
- friend class Instance;
-
- std::map<std::string, ::Ice::UserExceptionFactoryPtr> _factoryMap;
- std::map<std::string, ::Ice::UserExceptionFactoryPtr>::iterator _factoryMapHint;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_USER_EXCEPTION_FACTORY_MANAGER_H +#define ICE_USER_EXCEPTION_FACTORY_MANAGER_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Mutex.h> +#include <Ice/UserExceptionFactoryManagerF.h> +#include <Ice/UserExceptionFactoryF.h> + +namespace IceInternal +{ + +class UserExceptionFactoryManager : public ::IceUtil::Shared, public ::IceUtil::Mutex +{ +public: + + void add(const ::Ice::UserExceptionFactoryPtr&, const std::string&); + void remove(const std::string&); + ::Ice::UserExceptionFactoryPtr find(const std::string&); + +private: + + UserExceptionFactoryManager(); + void destroy(); + friend class Instance; + + std::map<std::string, ::Ice::UserExceptionFactoryPtr> _factoryMap; + std::map<std::string, ::Ice::UserExceptionFactoryPtr>::iterator _factoryMapHint; +}; + +} + +#endif diff --git a/cpp/src/Ice/UserExceptionFactoryManagerF.h b/cpp/src/Ice/UserExceptionFactoryManagerF.h index 5640d639ec9..9f4bb2deac8 100644 --- a/cpp/src/Ice/UserExceptionFactoryManagerF.h +++ b/cpp/src/Ice/UserExceptionFactoryManagerF.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_USER_EXCEPTION_FACTORY_MANAGER_F_H
-#define ICE_USER_EXCEPTION_FACTORY_MANAGER_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceInternal
-{
-
-class UserExceptionFactoryManager;
-void incRef(UserExceptionFactoryManager*);
-void decRef(UserExceptionFactoryManager*);
-typedef IceInternal::Handle<UserExceptionFactoryManager> UserExceptionFactoryManagerPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_USER_EXCEPTION_FACTORY_MANAGER_F_H +#define ICE_USER_EXCEPTION_FACTORY_MANAGER_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class UserExceptionFactoryManager; +void incRef(UserExceptionFactoryManager*); +void decRef(UserExceptionFactoryManager*); +typedef IceInternal::Handle<UserExceptionFactoryManager> UserExceptionFactoryManagerPtr; + +} + +#endif diff --git a/cpp/src/IceBox/ServiceManagerI.h b/cpp/src/IceBox/ServiceManagerI.h index 00a6de8a7b8..cbfa5edd8b7 100644 --- a/cpp/src/IceBox/ServiceManagerI.h +++ b/cpp/src/IceBox/ServiceManagerI.h @@ -1,56 +1,56 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SERVICE_MANAGER_I_H
-#define SERVICE_MANAGER_I_H
-
-#include <IceBox/IceBox.h>
-#include <Ice/LoggerF.h>
-#include <Ice/CommunicatorF.h>
-#include <Ice/DynamicLibraryF.h>
-#include <map>
-
-namespace IceBox
-{
-
-class ServiceManagerI : public ServiceManager
-{
-public:
-
- ServiceManagerI(::Ice::CommunicatorPtr, int&, char*[]);
- virtual ~ServiceManagerI();
-
- virtual void shutdown(const ::Ice::Current&);
-
- int run();
-
- struct ServiceInfo
- {
- ServicePtr service;
- ::IceInternal::DynamicLibraryPtr library;
- };
-
-private:
-
- ServicePtr init(const std::string&, const std::string&, const ::Ice::StringSeq&);
- void stop(const std::string&);
- void stopAll();
-
- ::Ice::CommunicatorPtr _communicator;
- ::Ice::LoggerPtr _logger;
- std::string _progName; // argv[0]
- ::Ice::StringSeq _argv; // Filtered server argument vector, not including program name
- ::Ice::StringSeq _options; // Server property set converted to command-line options
- std::map<std::string, ServiceInfo> _services;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SERVICE_MANAGER_I_H +#define SERVICE_MANAGER_I_H + +#include <IceBox/IceBox.h> +#include <Ice/LoggerF.h> +#include <Ice/CommunicatorF.h> +#include <Ice/DynamicLibraryF.h> +#include <map> + +namespace IceBox +{ + +class ServiceManagerI : public ServiceManager +{ +public: + + ServiceManagerI(::Ice::CommunicatorPtr, int&, char*[]); + virtual ~ServiceManagerI(); + + virtual void shutdown(const ::Ice::Current&); + + int run(); + + struct ServiceInfo + { + ServicePtr service; + ::IceInternal::DynamicLibraryPtr library; + }; + +private: + + ServicePtr init(const std::string&, const std::string&, const ::Ice::StringSeq&); + void stop(const std::string&); + void stopAll(); + + ::Ice::CommunicatorPtr _communicator; + ::Ice::LoggerPtr _logger; + std::string _progName; // argv[0] + ::Ice::StringSeq _argv; // Filtered server argument vector, not including program name + ::Ice::StringSeq _options; // Server property set converted to command-line options + std::map<std::string, ServiceInfo> _services; +}; + +} + +#endif diff --git a/cpp/src/IcePack/Activator.h b/cpp/src/IcePack/Activator.h index 764d3f85839..c5bb6943c1b 100644 --- a/cpp/src/IcePack/Activator.h +++ b/cpp/src/IcePack/Activator.h @@ -1,55 +1,55 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PACK_ACTIVATOR_H
-#define ICE_PACK_ACTIVATOR_H
-
-#include <IceUtil/Thread.h>
-
-namespace IcePack
-{
-
-struct ServerDescription;
-
-class Activator : public IceUtil::Thread, public IceUtil::Mutex
-{
-public:
-
- Activator(const Ice::CommunicatorPtr&);
- virtual ~Activator();
-
- virtual void run();
- void destroy();
- bool activate(const IcePack::ServerDescription&);
-
-private:
-
- void terminationListener();
- void clearInterrupt();
- void setInterrupt();
-
- struct Process
- {
- pid_t pid;
- int fd;
- };
-
- Ice::CommunicatorPtr _communicator;
- std::map<std::string, Process> _processes;
- bool _destroy;
- int _fdIntrRead;
- int _fdIntrWrite;
-};
-
-typedef IceUtil::Handle<Activator> ActivatorPtr;
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PACK_ACTIVATOR_H +#define ICE_PACK_ACTIVATOR_H + +#include <IceUtil/Thread.h> + +namespace IcePack +{ + +struct ServerDescription; + +class Activator : public IceUtil::Thread, public IceUtil::Mutex +{ +public: + + Activator(const Ice::CommunicatorPtr&); + virtual ~Activator(); + + virtual void run(); + void destroy(); + bool activate(const IcePack::ServerDescription&); + +private: + + void terminationListener(); + void clearInterrupt(); + void setInterrupt(); + + struct Process + { + pid_t pid; + int fd; + }; + + Ice::CommunicatorPtr _communicator; + std::map<std::string, Process> _processes; + bool _destroy; + int _fdIntrRead; + int _fdIntrWrite; +}; + +typedef IceUtil::Handle<Activator> ActivatorPtr; + +} + +#endif diff --git a/cpp/src/IcePack/AdminI.h b/cpp/src/IcePack/AdminI.h index 92d9c3e0fd8..6c000d2cbcc 100644 --- a/cpp/src/IcePack/AdminI.h +++ b/cpp/src/IcePack/AdminI.h @@ -1,38 +1,38 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PACK_ADMIN_I_H
-#define ICE_PACK_ADMIN_I_H
-
-#include <IcePack/Admin.h>
-
-namespace IcePack
-{
-
-class AdminI : public Admin, public IceUtil::Mutex
-{
-public:
-
- AdminI(const Ice::CommunicatorPtr&);
-
- virtual void add(const ServerDescription&, const Ice::Current&);
- virtual void remove(const Ice::Identity&, const Ice::Current&);
- virtual ServerDescription find(const Ice::Identity&, const Ice::Current&);
- virtual ServerDescriptions getAll(const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PACK_ADMIN_I_H +#define ICE_PACK_ADMIN_I_H + +#include <IcePack/Admin.h> + +namespace IcePack +{ + +class AdminI : public Admin, public IceUtil::Mutex +{ +public: + + AdminI(const Ice::CommunicatorPtr&); + + virtual void add(const ServerDescription&, const Ice::Current&); + virtual void remove(const Ice::Identity&, const Ice::Current&); + virtual ServerDescription find(const Ice::Identity&, const Ice::Current&); + virtual ServerDescriptions getAll(const Ice::Current&); + virtual void shutdown(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +} + +#endif diff --git a/cpp/src/IcePack/Forward.h b/cpp/src/IcePack/Forward.h index 3c73b5f10d3..ac2f2646238 100644 --- a/cpp/src/IcePack/Forward.h +++ b/cpp/src/IcePack/Forward.h @@ -1,46 +1,46 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PACK_FORWARD_H
-#define ICE_PACK_FORWARD_H
-
-#include <IcePack/AdminF.h>
-#ifndef _WIN32
-# include <IcePack/Activator.h>
-#endif
-
-namespace IcePack
-{
-
-class Forward : public Ice::ServantLocator
-{
-public:
-
- Forward(const Ice::CommunicatorPtr& communicator, const AdminPtr&);
- virtual ~Forward();
-
- virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&);
- virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&,
- const Ice::ObjectPtr&, const Ice::LocalObjectPtr&);
- virtual void deactivate();
-
-private:
-
- Ice::CommunicatorPtr _communicator;
- AdminPtr _admin;
-#ifndef _WIN32
- ActivatorPtr _activator;
- int _waitTime;
-#endif
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PACK_FORWARD_H +#define ICE_PACK_FORWARD_H + +#include <IcePack/AdminF.h> +#ifndef _WIN32 +# include <IcePack/Activator.h> +#endif + +namespace IcePack +{ + +class Forward : public Ice::ServantLocator +{ +public: + + Forward(const Ice::CommunicatorPtr& communicator, const AdminPtr&); + virtual ~Forward(); + + virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&); + virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&, + const Ice::ObjectPtr&, const Ice::LocalObjectPtr&); + virtual void deactivate(); + +private: + + Ice::CommunicatorPtr _communicator; + AdminPtr _admin; +#ifndef _WIN32 + ActivatorPtr _activator; + int _waitTime; +#endif +}; + +} + +#endif diff --git a/cpp/src/IcePack/Parser.h b/cpp/src/IcePack/Parser.h index 3d284a203c4..cbb3fb058d0 100644 --- a/cpp/src/IcePack/Parser.h +++ b/cpp/src/IcePack/Parser.h @@ -1,107 +1,107 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PACK_PARSER_H
-#define ICE_PACK_PARSER_H
-
-#include <IceUtil/Handle.h>
-#include <IcePack/Admin.h>
-#include <list>
-
-#ifdef _WIN32
-# include <io.h>
-# define isatty _isatty
-# define fileno _fileno
-// '_isatty' : inconsistent dll linkage. dllexport assumed.
-# pragma warning( disable : 4273 )
-#endif
-
-//
-// Stuff for flex and bison
-//
-
-#define YYSTYPE std::list<std::string>
-#define YY_DECL int yylex(YYSTYPE* yylvalp)
-YY_DECL;
-int yyparse();
-
-//
-// I must set the initial stack depth to the maximum stack depth to
-// disable bison stack resizing. The bison stack resizing routines use
-// simple malloc/alloc/memcpy calls, which do not work for the
-// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
-// assignment operator, etc.
-//
-#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
-#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
-
-//
-// Newer bison versions allow to disable stack resizing by defining
-// yyoverflow.
-//
-#define yyoverflow(a, b, c, d, e, f) yyerror(a)
-
-namespace IcePack
-{
-
-class Parser;
-typedef ::IceUtil::Handle<Parser> ParserPtr;
-
-}
-
-namespace IcePack
-{
-
-class Parser : public ::IceUtil::SimpleShared
-{
-public:
-
- static ParserPtr createParser(const Ice::CommunicatorPtr&, const IcePack::AdminPrx&);
-
- void usage();
-
- void add(const std::list<std::string>&);
- void remove(const std::list<std::string>&);
- void listAll();
- void shutdown();
-
- void getInput(char*, int&, int);
- void nextLine();
- void continueLine();
- char* getPrompt();
- void scanPosition(const char*);
-
- void error(const char*);
- void error(const std::string&);
-
- void warning(const char*);
- void warning(const std::string&);
-
- int parse(FILE*, bool);
- int parse(const std::string&, bool);
-
-private:
-
- Parser(const Ice::CommunicatorPtr&, const IcePack::AdminPrx&);
-
- std::string _commands;
- Ice::CommunicatorPtr _communicator;
- IcePack::AdminPrx _admin;
- bool _continue;
- int _errors;
- int _currentLine;
- std::string _currentFile;
-};
-
-extern Parser* parser; // The current parser for bison/flex
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PACK_PARSER_H +#define ICE_PACK_PARSER_H + +#include <IceUtil/Handle.h> +#include <IcePack/Admin.h> +#include <list> + +#ifdef _WIN32 +# include <io.h> +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. +# pragma warning( disable : 4273 ) +#endif + +// +// Stuff for flex and bison +// + +#define YYSTYPE std::list<std::string> +#define YY_DECL int yylex(YYSTYPE* yylvalp) +YY_DECL; +int yyparse(); + +// +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +// +#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum. +#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. + +// +// Newer bison versions allow to disable stack resizing by defining +// yyoverflow. +// +#define yyoverflow(a, b, c, d, e, f) yyerror(a) + +namespace IcePack +{ + +class Parser; +typedef ::IceUtil::Handle<Parser> ParserPtr; + +} + +namespace IcePack +{ + +class Parser : public ::IceUtil::SimpleShared +{ +public: + + static ParserPtr createParser(const Ice::CommunicatorPtr&, const IcePack::AdminPrx&); + + void usage(); + + void add(const std::list<std::string>&); + void remove(const std::list<std::string>&); + void listAll(); + void shutdown(); + + void getInput(char*, int&, int); + void nextLine(); + void continueLine(); + char* getPrompt(); + void scanPosition(const char*); + + void error(const char*); + void error(const std::string&); + + void warning(const char*); + void warning(const std::string&); + + int parse(FILE*, bool); + int parse(const std::string&, bool); + +private: + + Parser(const Ice::CommunicatorPtr&, const IcePack::AdminPrx&); + + std::string _commands; + Ice::CommunicatorPtr _communicator; + IcePack::AdminPrx _admin; + bool _continue; + int _errors; + int _currentLine; + std::string _currentFile; +}; + +extern Parser* parser; // The current parser for bison/flex + +} + +#endif diff --git a/cpp/src/IcePack/dummyinclude/unistd.h b/cpp/src/IcePack/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/src/IcePack/dummyinclude/unistd.h +++ b/cpp/src/IcePack/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/src/IcePatch/FileLocator.h b/cpp/src/IcePatch/FileLocator.h index c8290ad761a..83c77f15b0a 100644 --- a/cpp/src/IcePatch/FileLocator.h +++ b/cpp/src/IcePatch/FileLocator.h @@ -1,41 +1,41 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PATCH_FILE_LOCATOR_H
-#define ICE_PATCH_FILE_LOCATOR_H
-
-#include <Ice/Ice.h>
-#include <IcePatch/IcePatch.h>
-
-namespace IcePatch
-{
-
-class FileLocator: virtual public Ice::ServantLocator
-{
-public:
-
- FileLocator(const Ice::ObjectAdapterPtr&);
-
- virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&);
-
- virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&, const Ice::ObjectPtr&,
- const Ice::LocalObjectPtr&);
-
- virtual void deactivate();
-
-private:
-
- DirectoryPtr _directory; // The stateless default servant for all directories.
- RegularPtr _regular; // The stateless default servant for all regular files.
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PATCH_FILE_LOCATOR_H +#define ICE_PATCH_FILE_LOCATOR_H + +#include <Ice/Ice.h> +#include <IcePatch/IcePatch.h> + +namespace IcePatch +{ + +class FileLocator: virtual public Ice::ServantLocator +{ +public: + + FileLocator(const Ice::ObjectAdapterPtr&); + + virtual Ice::ObjectPtr locate(const Ice::ObjectAdapterPtr&, const Ice::Current&, Ice::LocalObjectPtr&); + + virtual void finished(const Ice::ObjectAdapterPtr&, const Ice::Current&, const Ice::ObjectPtr&, + const Ice::LocalObjectPtr&); + + virtual void deactivate(); + +private: + + DirectoryPtr _directory; // The stateless default servant for all directories. + RegularPtr _regular; // The stateless default servant for all regular files. +}; + +} + +#endif diff --git a/cpp/src/IcePatch/IcePatchI.h b/cpp/src/IcePatch/IcePatchI.h index fb9f636eca9..040b7d9e9c8 100644 --- a/cpp/src/IcePatch/IcePatchI.h +++ b/cpp/src/IcePatch/IcePatchI.h @@ -1,62 +1,62 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_PATCH_ICE_PATCH_I_H
-#define ICE_PATCH_ICE_PATCH_I_H
-
-#include <Ice/Ice.h>
-#include <IceUtil/RWRecMutex.h>
-#include <IcePatch/IcePatch.h>
-
-namespace IcePatch
-{
-
-class FileI : virtual public File
-{
-public:
-
- FileI(const Ice::ObjectAdapterPtr&);
-
-protected:
-
- Ice::ObjectAdapterPtr _adapter;
- Ice::LoggerPtr _logger;
- Ice::Int _traceLevel;
- IceUtil::Time _busyTimeout;
- static IceUtil::RWRecMutex _globalMutex;
-};
-
-class DirectoryI : virtual public Directory,
- virtual public FileI
-{
-public:
-
- DirectoryI(const Ice::ObjectAdapterPtr&);
-
- virtual FileDescPtr describe(const Ice::Current&);
- virtual FileDescSeq getContents(const Ice::Current&);
-};
-
-class RegularI : virtual public Regular,
- virtual public FileI
-{
-public:
-
- RegularI(const Ice::ObjectAdapterPtr&);
-
- virtual FileDescPtr describe(const Ice::Current&);
- virtual Ice::Int getBZ2Size(const Ice::Current&);
- virtual Ice::ByteSeq getBZ2(Ice::Int, Ice::Int, const Ice::Current&);
- virtual Ice::ByteSeq getBZ2MD5(Ice::Int, const Ice::Current&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_PATCH_ICE_PATCH_I_H +#define ICE_PATCH_ICE_PATCH_I_H + +#include <Ice/Ice.h> +#include <IceUtil/RWRecMutex.h> +#include <IcePatch/IcePatch.h> + +namespace IcePatch +{ + +class FileI : virtual public File +{ +public: + + FileI(const Ice::ObjectAdapterPtr&); + +protected: + + Ice::ObjectAdapterPtr _adapter; + Ice::LoggerPtr _logger; + Ice::Int _traceLevel; + IceUtil::Time _busyTimeout; + static IceUtil::RWRecMutex _globalMutex; +}; + +class DirectoryI : virtual public Directory, + virtual public FileI +{ +public: + + DirectoryI(const Ice::ObjectAdapterPtr&); + + virtual FileDescPtr describe(const Ice::Current&); + virtual FileDescSeq getContents(const Ice::Current&); +}; + +class RegularI : virtual public Regular, + virtual public FileI +{ +public: + + RegularI(const Ice::ObjectAdapterPtr&); + + virtual FileDescPtr describe(const Ice::Current&); + virtual Ice::Int getBZ2Size(const Ice::Current&); + virtual Ice::ByteSeq getBZ2(Ice::Int, Ice::Int, const Ice::Current&); + virtual Ice::ByteSeq getBZ2MD5(Ice::Int, const Ice::Current&); +}; + +} + +#endif diff --git a/cpp/src/IceSSL/BaseCerts.h b/cpp/src/IceSSL/BaseCerts.h index 86b30e01790..a78823d384c 100644 --- a/cpp/src/IceSSL/BaseCerts.h +++ b/cpp/src/IceSSL/BaseCerts.h @@ -1,68 +1,68 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_BASE_CERTS_H
-#define ICE_SSL_BASE_CERTS_H
-
-#include <IceSSL/CertificateDesc.h>
-
-namespace IceSSL
-{
-
-class BaseCertificates
-{
-public:
-
- BaseCertificates();
- BaseCertificates(CertificateDesc&, CertificateDesc&, DiffieHellmanParamsFile&);
- BaseCertificates(BaseCertificates&);
-
- const CertificateDesc& getRSACert() const;
- const CertificateDesc& getDSACert() const;
-
- const DiffieHellmanParamsFile& getDHParams() const;
-
-protected:
-
- CertificateDesc _rsaCert;
- CertificateDesc _dsaCert;
- DiffieHellmanParamsFile _dhParams;
-};
-
-template<class Stream>
-inline Stream& operator << (Stream& target, const BaseCertificates& baseCerts)
-{
- if(baseCerts.getRSACert().getKeySize() != 0)
- {
- target << "RSA\n{" << std::endl;
- target << baseCerts.getRSACert();
- target << "}\n" << std::endl;
- }
-
- if(baseCerts.getDSACert().getKeySize() != 0)
- {
- target << "DSA\n{" << std::endl;
- target << baseCerts.getDSACert();
- target << "}\n" << std::endl;
- }
-
- if(baseCerts.getDHParams().getKeySize() != 0)
- {
- target << "DH\n{" << std::endl;
- target << baseCerts.getDHParams();
- target << "}\n" << std::endl;
- }
-
- return target;
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_BASE_CERTS_H +#define ICE_SSL_BASE_CERTS_H + +#include <IceSSL/CertificateDesc.h> + +namespace IceSSL +{ + +class BaseCertificates +{ +public: + + BaseCertificates(); + BaseCertificates(CertificateDesc&, CertificateDesc&, DiffieHellmanParamsFile&); + BaseCertificates(BaseCertificates&); + + const CertificateDesc& getRSACert() const; + const CertificateDesc& getDSACert() const; + + const DiffieHellmanParamsFile& getDHParams() const; + +protected: + + CertificateDesc _rsaCert; + CertificateDesc _dsaCert; + DiffieHellmanParamsFile _dhParams; +}; + +template<class Stream> +inline Stream& operator << (Stream& target, const BaseCertificates& baseCerts) +{ + if(baseCerts.getRSACert().getKeySize() != 0) + { + target << "RSA\n{" << std::endl; + target << baseCerts.getRSACert(); + target << "}\n" << std::endl; + } + + if(baseCerts.getDSACert().getKeySize() != 0) + { + target << "DSA\n{" << std::endl; + target << baseCerts.getDSACert(); + target << "}\n" << std::endl; + } + + if(baseCerts.getDHParams().getKeySize() != 0) + { + target << "DH\n{" << std::endl; + target << baseCerts.getDHParams(); + target << "}\n" << std::endl; + } + + return target; +} + +} + +#endif diff --git a/cpp/src/IceSSL/CertificateAuthority.h b/cpp/src/IceSSL/CertificateAuthority.h index 058c9a6b02d..5447aa2140e 100644 --- a/cpp/src/IceSSL/CertificateAuthority.h +++ b/cpp/src/IceSSL/CertificateAuthority.h @@ -1,41 +1,41 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CERTIFICATE_AUTHORITY_H
-#define ICE_SSL_CERTIFICATE_AUTHORITY_H
-
-#include <IceUtil/Config.h>
-
-namespace IceSSL
-{
-
-class CertificateAuthority
-{
-public:
-
- CertificateAuthority();
- CertificateAuthority(std::string&, std::string&);
- CertificateAuthority(CertificateAuthority&);
-
- void setCAFileName(std::string&);
- void setCAPath(std::string&);
-
- const std::string& getCAFileName() const;
- const std::string& getCAPath() const;
-
-private:
-
- std::string _fileName;
- std::string _path;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CERTIFICATE_AUTHORITY_H +#define ICE_SSL_CERTIFICATE_AUTHORITY_H + +#include <IceUtil/Config.h> + +namespace IceSSL +{ + +class CertificateAuthority +{ +public: + + CertificateAuthority(); + CertificateAuthority(std::string&, std::string&); + CertificateAuthority(CertificateAuthority&); + + void setCAFileName(std::string&); + void setCAPath(std::string&); + + const std::string& getCAFileName() const; + const std::string& getCAPath() const; + +private: + + std::string _fileName; + std::string _path; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/CertificateDesc.h b/cpp/src/IceSSL/CertificateDesc.h index d7e758bfd66..061af0266a1 100644 --- a/cpp/src/IceSSL/CertificateDesc.h +++ b/cpp/src/IceSSL/CertificateDesc.h @@ -1,119 +1,119 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CERTIFICATE_DESC_H
-#define ICE_SSL_CERTIFICATE_DESC_H
-
-#include <IceUtil/Config.h>
-#include <openssl/ssl.h>
-#include <vector>
-
-namespace IceSSL
-{
-
-class CertificateFile
-{
-public:
-
- CertificateFile();
- CertificateFile(const std::string&, const int);
- CertificateFile(const CertificateFile&);
-
- std::string getFileName() const;
- int getEncoding() const;
-
-protected:
-
- std::string _fileName;
- int _encoding;
-};
-
-class DiffieHellmanParamsFile : public CertificateFile
-{
-public:
-
- DiffieHellmanParamsFile();
- DiffieHellmanParamsFile(const int, const std::string&, const int);
- DiffieHellmanParamsFile(const DiffieHellmanParamsFile&);
-
- int getKeySize() const;
-
-protected:
-
- int _keySize;
-};
-
-class CertificateDesc
-{
-public:
-
- CertificateDesc();
- CertificateDesc(const int, const CertificateFile&, const CertificateFile&);
- CertificateDesc(const CertificateDesc&);
-
- int getKeySize() const;
-
- const CertificateFile& getPublic() const;
- const CertificateFile& getPrivate() const;
-
-protected:
-
- int _keySize;
- CertificateFile _public;
- CertificateFile _private;
-};
-
-typedef std::vector<CertificateDesc> RSAVector;
-typedef std::vector<CertificateDesc> DSAVector;
-typedef std::vector<DiffieHellmanParamsFile> DHVector;
-
-template<class Stream>
-inline Stream& operator << (Stream& target, const CertificateFile& certFile)
-{
- if(certFile.getEncoding() == SSL_FILETYPE_PEM)
- {
- target << "[PEM]: " << certFile.getFileName();
- }
- else if(certFile.getEncoding() == SSL_FILETYPE_ASN1)
- {
- target << "[ASN1]: " << certFile.getFileName();
- }
-
- return target;
-}
-
-template<class Stream>
-inline Stream& operator << (Stream& target, const DiffieHellmanParamsFile& dhParams)
-{
- if(dhParams.getKeySize() != 0)
- {
- target << "Keysize: " << dhParams.getKeySize() << std::endl;
- target << "File: " << ((CertificateFile&)dhParams) << std::endl;
- }
-
- return target;
-}
-
-template<class Stream>
-inline Stream& operator << (Stream& target, const CertificateDesc& certDesc)
-{
- if(certDesc.getKeySize() != 0)
- {
- target << "Keysize: " << certDesc.getKeySize() << std::endl;
- target << "Public: " << certDesc.getPublic() << std::endl;
- target << "Private: " << certDesc.getPrivate() << std::endl;
- }
-
- return target;
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CERTIFICATE_DESC_H +#define ICE_SSL_CERTIFICATE_DESC_H + +#include <IceUtil/Config.h> +#include <openssl/ssl.h> +#include <vector> + +namespace IceSSL +{ + +class CertificateFile +{ +public: + + CertificateFile(); + CertificateFile(const std::string&, const int); + CertificateFile(const CertificateFile&); + + std::string getFileName() const; + int getEncoding() const; + +protected: + + std::string _fileName; + int _encoding; +}; + +class DiffieHellmanParamsFile : public CertificateFile +{ +public: + + DiffieHellmanParamsFile(); + DiffieHellmanParamsFile(const int, const std::string&, const int); + DiffieHellmanParamsFile(const DiffieHellmanParamsFile&); + + int getKeySize() const; + +protected: + + int _keySize; +}; + +class CertificateDesc +{ +public: + + CertificateDesc(); + CertificateDesc(const int, const CertificateFile&, const CertificateFile&); + CertificateDesc(const CertificateDesc&); + + int getKeySize() const; + + const CertificateFile& getPublic() const; + const CertificateFile& getPrivate() const; + +protected: + + int _keySize; + CertificateFile _public; + CertificateFile _private; +}; + +typedef std::vector<CertificateDesc> RSAVector; +typedef std::vector<CertificateDesc> DSAVector; +typedef std::vector<DiffieHellmanParamsFile> DHVector; + +template<class Stream> +inline Stream& operator << (Stream& target, const CertificateFile& certFile) +{ + if(certFile.getEncoding() == SSL_FILETYPE_PEM) + { + target << "[PEM]: " << certFile.getFileName(); + } + else if(certFile.getEncoding() == SSL_FILETYPE_ASN1) + { + target << "[ASN1]: " << certFile.getFileName(); + } + + return target; +} + +template<class Stream> +inline Stream& operator << (Stream& target, const DiffieHellmanParamsFile& dhParams) +{ + if(dhParams.getKeySize() != 0) + { + target << "Keysize: " << dhParams.getKeySize() << std::endl; + target << "File: " << ((CertificateFile&)dhParams) << std::endl; + } + + return target; +} + +template<class Stream> +inline Stream& operator << (Stream& target, const CertificateDesc& certDesc) +{ + if(certDesc.getKeySize() != 0) + { + target << "Keysize: " << certDesc.getKeySize() << std::endl; + target << "Public: " << certDesc.getPublic() << std::endl; + target << "Private: " << certDesc.getPrivate() << std::endl; + } + + return target; +} + +} + +#endif diff --git a/cpp/src/IceSSL/ConfigParser.h b/cpp/src/IceSSL/ConfigParser.h index bbe6158ac65..c88201b0019 100644 --- a/cpp/src/IceSSL/ConfigParser.h +++ b/cpp/src/IceSSL/ConfigParser.h @@ -1,89 +1,89 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONFIG_H
-#define ICE_SSL_CONFIG_H
-
-#include <Ice/LoggerF.h>
-#include <IceSSL/CertificateDesc.h>
-#include <IceSSL/GeneralConfig.h>
-#include <IceSSL/CertificateAuthority.h>
-#include <IceSSL/BaseCerts.h>
-#include <IceSSL/TempCerts.h>
-#include <IceSSL/TraceLevelsF.h>
-#include <dom/DOM.hpp>
-
-namespace IceSSL
-{
-
-class ConfigParser
-{
-public:
-
- // Construction based on the indicated config file, or config file and
- // certificate path.
- ConfigParser(const std::string&);
- ConfigParser(const std::string&, const std::string&);
- ~ConfigParser();
-
- // Performs a complete parsing of the file.
- void process();
-
- // Loads the Client/Server portions of the config file.
- bool loadClientConfig(GeneralConfig&, CertificateAuthority&, BaseCertificates&);
- bool loadServerConfig(GeneralConfig&, CertificateAuthority&, BaseCertificates&, TempCertificates&);
-
- void setTrace(const TraceLevelsPtr&);
- bool isTraceSet() const;
-
- void setLogger(const Ice::LoggerPtr&);
- bool isLoggerSet() const;
-
-private:
-
- DOM_Node _root;
- std::string _configFile;
- std::string _configPath;
-
- TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
-
- // Parse tree walking utility methods.
- void popRoot(std::string&, std::string&, std::string&);
- DOM_Node find(std::string&);
- DOM_Node find(DOM_Node, std::string&);
-
- // Loading of the base elements of the file.
- void getGeneral(DOM_Node, GeneralConfig&);
- void getCertAuth(DOM_Node, CertificateAuthority&);
- void getBaseCerts(DOM_Node, BaseCertificates&);
- void getTempCerts(DOM_Node, TempCertificates&);
-
- // Loading of temporary certificates/params (Ephemeral Keys).
- void loadDHParams(DOM_Node, TempCertificates&);
- void loadRSACert(DOM_Node, TempCertificates&);
-
- // Populate with information from the indicated node in the parse tree.
- void getCert(DOM_Node, CertificateDesc&);
- void getDHParams(DOM_Node, DiffieHellmanParamsFile&);
-
- // Populate a certificate file object, basis of all certificates.
- void loadCertificateFile(DOM_Node, CertificateFile&);
-
- // Parses the certificate encoding format from a string representation
- // to the proper integer value used by the underlying SSL framework.
- int parseEncoding(std::string&);
-
- std::string toString(const DOMString&);
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONFIG_H +#define ICE_SSL_CONFIG_H + +#include <Ice/LoggerF.h> +#include <IceSSL/CertificateDesc.h> +#include <IceSSL/GeneralConfig.h> +#include <IceSSL/CertificateAuthority.h> +#include <IceSSL/BaseCerts.h> +#include <IceSSL/TempCerts.h> +#include <IceSSL/TraceLevelsF.h> +#include <dom/DOM.hpp> + +namespace IceSSL +{ + +class ConfigParser +{ +public: + + // Construction based on the indicated config file, or config file and + // certificate path. + ConfigParser(const std::string&); + ConfigParser(const std::string&, const std::string&); + ~ConfigParser(); + + // Performs a complete parsing of the file. + void process(); + + // Loads the Client/Server portions of the config file. + bool loadClientConfig(GeneralConfig&, CertificateAuthority&, BaseCertificates&); + bool loadServerConfig(GeneralConfig&, CertificateAuthority&, BaseCertificates&, TempCertificates&); + + void setTrace(const TraceLevelsPtr&); + bool isTraceSet() const; + + void setLogger(const Ice::LoggerPtr&); + bool isLoggerSet() const; + +private: + + DOM_Node _root; + std::string _configFile; + std::string _configPath; + + TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + + // Parse tree walking utility methods. + void popRoot(std::string&, std::string&, std::string&); + DOM_Node find(std::string&); + DOM_Node find(DOM_Node, std::string&); + + // Loading of the base elements of the file. + void getGeneral(DOM_Node, GeneralConfig&); + void getCertAuth(DOM_Node, CertificateAuthority&); + void getBaseCerts(DOM_Node, BaseCertificates&); + void getTempCerts(DOM_Node, TempCertificates&); + + // Loading of temporary certificates/params (Ephemeral Keys). + void loadDHParams(DOM_Node, TempCertificates&); + void loadRSACert(DOM_Node, TempCertificates&); + + // Populate with information from the indicated node in the parse tree. + void getCert(DOM_Node, CertificateDesc&); + void getDHParams(DOM_Node, DiffieHellmanParamsFile&); + + // Populate a certificate file object, basis of all certificates. + void loadCertificateFile(DOM_Node, CertificateFile&); + + // Parses the certificate encoding format from a string representation + // to the proper integer value used by the underlying SSL framework. + int parseEncoding(std::string&); + + std::string toString(const DOMString&); +}; + +} + +#endif diff --git a/cpp/src/IceSSL/ConfigParserErrorReporter.h b/cpp/src/IceSSL/ConfigParserErrorReporter.h index 192917fd2d8..2b94b4c1d74 100644 --- a/cpp/src/IceSSL/ConfigParserErrorReporter.h +++ b/cpp/src/IceSSL/ConfigParserErrorReporter.h @@ -1,63 +1,63 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONFIG_ERROR_REPORTER_H
-#define ICE_SSL_CONFIG_ERROR_REPORTER_H
-
-#include <Ice/LoggerF.h>
-#include <IceSSL/TraceLevelsF.h>
-#include <util/XercesDefs.hpp>
-#include <dom/DOMString.hpp>
-#include <sax/ErrorHandler.hpp>
-
-namespace IceSSL
-{
-
-class ConfigParserErrorReporter : public ErrorHandler, public IceUtil::Shared
-{
-public:
-
- ConfigParserErrorReporter(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&);
- ~ConfigParserErrorReporter();
-
- // Implementation of the error handler interface.
- void warning(const SAXParseException& toCatch);
- void error(const SAXParseException& toCatch);
- void fatalError(const SAXParseException& toCatch);
- void resetErrors();
-
- bool getSawErrors() const;
- std::string getErrors() const;
-
-private:
-
- IceSSL::TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
-
- // Any errors that are encountered will be output to this stream.
- std::ostringstream _errors;
- int _errorCount;
-};
-
-typedef IceInternal::Handle<ConfigParserErrorReporter> ConfigParserErrorReporterPtr;
-
-std::ostream& operator << (std::ostream& target, const DOMString& s);
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::ConfigParserErrorReporter*);
-void decRef(::IceSSL::ConfigParserErrorReporter*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONFIG_ERROR_REPORTER_H +#define ICE_SSL_CONFIG_ERROR_REPORTER_H + +#include <Ice/LoggerF.h> +#include <IceSSL/TraceLevelsF.h> +#include <util/XercesDefs.hpp> +#include <dom/DOMString.hpp> +#include <sax/ErrorHandler.hpp> + +namespace IceSSL +{ + +class ConfigParserErrorReporter : public ErrorHandler, public IceUtil::Shared +{ +public: + + ConfigParserErrorReporter(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&); + ~ConfigParserErrorReporter(); + + // Implementation of the error handler interface. + void warning(const SAXParseException& toCatch); + void error(const SAXParseException& toCatch); + void fatalError(const SAXParseException& toCatch); + void resetErrors(); + + bool getSawErrors() const; + std::string getErrors() const; + +private: + + IceSSL::TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + + // Any errors that are encountered will be output to this stream. + std::ostringstream _errors; + int _errorCount; +}; + +typedef IceInternal::Handle<ConfigParserErrorReporter> ConfigParserErrorReporterPtr; + +std::ostream& operator << (std::ostream& target, const DOMString& s); + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::ConfigParserErrorReporter*); +void decRef(::IceSSL::ConfigParserErrorReporter*); + +} + +#endif diff --git a/cpp/src/IceSSL/ContextOpenSSL.h b/cpp/src/IceSSL/ContextOpenSSL.h index 0d885c0ffdb..b8933cbb69e 100644 --- a/cpp/src/IceSSL/ContextOpenSSL.h +++ b/cpp/src/IceSSL/ContextOpenSSL.h @@ -1,120 +1,120 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONTEXT_OPENSSL_H
-#define ICE_SSL_CONTEXT_OPENSSL_H
-
-#include <Ice/LoggerF.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/BuiltinSequences.h>
-#include <IceSSL/OpenSSL.h>
-#include <IceSSL/TraceLevelsF.h>
-#include <IceSSL/CertificateVerifierOpenSSL.h>
-#include <IceSSL/GeneralConfig.h>
-#include <IceSSL/CertificateAuthority.h>
-#include <IceSSL/BaseCerts.h>
-#include <IceSSL/TempCerts.h>
-#include <IceSSL/SslConnectionF.h>
-#include <IceSSL/SslConnectionOpenSSLF.h>
-#include <IceSSL/ContextOpenSSLF.h>
-#include <IceSSL/RSAPublicKey.h>
-#include <IceSSL/RSAKeyPairF.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class PluginI;
-
-class Context : public IceUtil::Shared
-{
-public:
-
- virtual ~Context();
-
- bool isConfigured();
-
- virtual void setCertificateVerifier(const CertificateVerifierPtr&);
-
- virtual void addTrustedCertificateBase64(const std::string&);
-
- virtual void addTrustedCertificate(const Ice::ByteSeq&);
-
- virtual void setRSAKeysBase64(const std::string&, const std::string&);
-
- virtual void setRSAKeys(const Ice::ByteSeq&, const Ice::ByteSeq&);
-
- virtual void configure(const IceSSL::GeneralConfig&,
- const IceSSL::CertificateAuthority&,
- const IceSSL::BaseCertificates&);
-
- // Takes a socket fd as the first parameter.
- virtual ::IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&) = 0;
-
-protected:
-
- Context(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&);
-
- SSL_METHOD* getSslMethod(SslProtocol);
- void createContext(SslProtocol);
-
- virtual void loadCertificateAuthority(const CertificateAuthority&);
-
- void setKeyCert(const IceSSL::CertificateDesc&, const std::string&, const std::string&);
-
- void checkKeyCert();
-
- void addTrustedCertificate(const IceSSL::OpenSSL::RSAPublicKey&);
-
- void addKeyCert(const IceSSL::CertificateFile&, const IceSSL::CertificateFile&);
-
- void addKeyCert(const RSAKeyPair&);
-
- void addKeyCert(const Ice::ByteSeq&, const Ice::ByteSeq&);
-
- void addKeyCert(const std::string&, const std::string&);
-
- SSL* createSSLConnection(int);
-
- void connectionSetup(const IceSSL::OpenSSL::ConnectionPtr& connection);
-
- void setCipherList(const std::string&);
-
- void setDHParams(const IceSSL::BaseCertificates&);
-
- IceSSL::TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
- Ice::PropertiesPtr _properties;
-
- std::string _rsaPrivateKeyProperty;
- std::string _rsaPublicKeyProperty;
- std::string _dsaPrivateKeyProperty;
- std::string _dsaPublicKeyProperty;
- std::string _caCertificateProperty;
- std::string _handshakeTimeoutProperty;
- std::string _passphraseRetriesProperty;
- std::string _maxPassphraseRetriesDefault;
-
- IceSSL::CertificateVerifierPtr _certificateVerifier;
-
- SSL_CTX* _sslContext;
-
- int _maxPassphraseTries;
-
- friend class IceSSL::OpenSSL::PluginI;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONTEXT_OPENSSL_H +#define ICE_SSL_CONTEXT_OPENSSL_H + +#include <Ice/LoggerF.h> +#include <Ice/PropertiesF.h> +#include <Ice/BuiltinSequences.h> +#include <IceSSL/OpenSSL.h> +#include <IceSSL/TraceLevelsF.h> +#include <IceSSL/CertificateVerifierOpenSSL.h> +#include <IceSSL/GeneralConfig.h> +#include <IceSSL/CertificateAuthority.h> +#include <IceSSL/BaseCerts.h> +#include <IceSSL/TempCerts.h> +#include <IceSSL/SslConnectionF.h> +#include <IceSSL/SslConnectionOpenSSLF.h> +#include <IceSSL/ContextOpenSSLF.h> +#include <IceSSL/RSAPublicKey.h> +#include <IceSSL/RSAKeyPairF.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class PluginI; + +class Context : public IceUtil::Shared +{ +public: + + virtual ~Context(); + + bool isConfigured(); + + virtual void setCertificateVerifier(const CertificateVerifierPtr&); + + virtual void addTrustedCertificateBase64(const std::string&); + + virtual void addTrustedCertificate(const Ice::ByteSeq&); + + virtual void setRSAKeysBase64(const std::string&, const std::string&); + + virtual void setRSAKeys(const Ice::ByteSeq&, const Ice::ByteSeq&); + + virtual void configure(const IceSSL::GeneralConfig&, + const IceSSL::CertificateAuthority&, + const IceSSL::BaseCertificates&); + + // Takes a socket fd as the first parameter. + virtual ::IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&) = 0; + +protected: + + Context(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&); + + SSL_METHOD* getSslMethod(SslProtocol); + void createContext(SslProtocol); + + virtual void loadCertificateAuthority(const CertificateAuthority&); + + void setKeyCert(const IceSSL::CertificateDesc&, const std::string&, const std::string&); + + void checkKeyCert(); + + void addTrustedCertificate(const IceSSL::OpenSSL::RSAPublicKey&); + + void addKeyCert(const IceSSL::CertificateFile&, const IceSSL::CertificateFile&); + + void addKeyCert(const RSAKeyPair&); + + void addKeyCert(const Ice::ByteSeq&, const Ice::ByteSeq&); + + void addKeyCert(const std::string&, const std::string&); + + SSL* createSSLConnection(int); + + void connectionSetup(const IceSSL::OpenSSL::ConnectionPtr& connection); + + void setCipherList(const std::string&); + + void setDHParams(const IceSSL::BaseCertificates&); + + IceSSL::TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + Ice::PropertiesPtr _properties; + + std::string _rsaPrivateKeyProperty; + std::string _rsaPublicKeyProperty; + std::string _dsaPrivateKeyProperty; + std::string _dsaPublicKeyProperty; + std::string _caCertificateProperty; + std::string _handshakeTimeoutProperty; + std::string _passphraseRetriesProperty; + std::string _maxPassphraseRetriesDefault; + + IceSSL::CertificateVerifierPtr _certificateVerifier; + + SSL_CTX* _sslContext; + + int _maxPassphraseTries; + + friend class IceSSL::OpenSSL::PluginI; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/ContextOpenSSLClient.h b/cpp/src/IceSSL/ContextOpenSSLClient.h index 8c4036db20e..263078a53e9 100644 --- a/cpp/src/IceSSL/ContextOpenSSLClient.h +++ b/cpp/src/IceSSL/ContextOpenSSLClient.h @@ -1,44 +1,44 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONTEXT_OPENSSL_CLIENT_H
-#define ICE_SSL_CONTEXT_OPENSSL_CLIENT_H
-
-#include <IceSSL/ContextOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ClientContext : public Context
-{
-public:
-
- virtual void configure(const IceSSL::GeneralConfig&,
- const IceSSL::CertificateAuthority&,
- const IceSSL::BaseCertificates&);
-
- // Takes a socket fd as the first parameter.
- virtual IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&);
-
-protected:
-
- ClientContext(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&);
-
- friend class IceSSL::OpenSSL::PluginI;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONTEXT_OPENSSL_CLIENT_H +#define ICE_SSL_CONTEXT_OPENSSL_CLIENT_H + +#include <IceSSL/ContextOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ClientContext : public Context +{ +public: + + virtual void configure(const IceSSL::GeneralConfig&, + const IceSSL::CertificateAuthority&, + const IceSSL::BaseCertificates&); + + // Takes a socket fd as the first parameter. + virtual IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&); + +protected: + + ClientContext(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&); + + friend class IceSSL::OpenSSL::PluginI; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/ContextOpenSSLF.h b/cpp/src/IceSSL/ContextOpenSSLF.h index 322c3d0b5aa..fd338e10a58 100644 --- a/cpp/src/IceSSL/ContextOpenSSLF.h +++ b/cpp/src/IceSSL/ContextOpenSSLF.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONTEXT_OPENSSL_F_H
-#define ICE_SSL_CONTEXT_OPENSSL_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class Context;
-typedef IceInternal::Handle<Context> ContextPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::OpenSSL::Context*);
-void decRef(::IceSSL::OpenSSL::Context*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONTEXT_OPENSSL_F_H +#define ICE_SSL_CONTEXT_OPENSSL_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class Context; +typedef IceInternal::Handle<Context> ContextPtr; + +} + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::OpenSSL::Context*); +void decRef(::IceSSL::OpenSSL::Context*); + +} + +#endif diff --git a/cpp/src/IceSSL/ContextOpenSSLServer.h b/cpp/src/IceSSL/ContextOpenSSLServer.h index 66fa31d13c3..4818d0bfc82 100644 --- a/cpp/src/IceSSL/ContextOpenSSLServer.h +++ b/cpp/src/IceSSL/ContextOpenSSLServer.h @@ -1,46 +1,46 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONTEXT_OPENSSL_SERVER_H
-#define ICE_SSL_CONTEXT_OPENSSL_SERVER_H
-
-#include <IceSSL/ContextOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ServerContext : public Context
-{
-public:
-
- virtual void configure(const IceSSL::GeneralConfig&,
- const IceSSL::CertificateAuthority&,
- const IceSSL::BaseCertificates&);
-
- // Takes a socket fd as the first parameter.
- virtual IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&);
-
-protected:
-
- ServerContext(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&);
-
- virtual void loadCertificateAuthority(const IceSSL::CertificateAuthority& certAuth);
-
- friend class IceSSL::OpenSSL::PluginI;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONTEXT_OPENSSL_SERVER_H +#define ICE_SSL_CONTEXT_OPENSSL_SERVER_H + +#include <IceSSL/ContextOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ServerContext : public Context +{ +public: + + virtual void configure(const IceSSL::GeneralConfig&, + const IceSSL::CertificateAuthority&, + const IceSSL::BaseCertificates&); + + // Takes a socket fd as the first parameter. + virtual IceSSL::ConnectionPtr createConnection(int, const IceSSL::PluginBaseIPtr&); + +protected: + + ServerContext(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&, const Ice::PropertiesPtr&); + + virtual void loadCertificateAuthority(const IceSSL::CertificateAuthority& certAuth); + + friend class IceSSL::OpenSSL::PluginI; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/Convert.h b/cpp/src/IceSSL/Convert.h index ea5e2452d6f..a4bce9fdbd9 100644 --- a/cpp/src/IceSSL/Convert.h +++ b/cpp/src/IceSSL/Convert.h @@ -1,26 +1,26 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONVERT_H
-#define ICE_SSL_CONVERT_H
-
-#include <Ice/BuiltinSequences.h>
-
-namespace IceSSL
-{
-
-void ucharToByteSeq(unsigned char*, int, Ice::ByteSeq&);
-
-unsigned char* byteSeqToUChar(const Ice::ByteSeq&);
-
-}
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONVERT_H +#define ICE_SSL_CONVERT_H + +#include <Ice/BuiltinSequences.h> + +namespace IceSSL +{ + +void ucharToByteSeq(unsigned char*, int, Ice::ByteSeq&); + +unsigned char* byteSeqToUChar(const Ice::ByteSeq&); + +} + +#endif + diff --git a/cpp/src/IceSSL/DHParams.h b/cpp/src/IceSSL/DHParams.h index 1981d2dae8d..446917a1c09 100644 --- a/cpp/src/IceSSL/DHParams.h +++ b/cpp/src/IceSSL/DHParams.h @@ -1,45 +1,45 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DH_PARAMS_H
-#define ICE_DH_PARAMS_H
-
-#include <IceUtil/Shared.h>
-#include <IceSSL/DHParamsF.h>
-#include <openssl/ssl.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class DHParams : public IceUtil::Shared
-{
-public:
-
- // Construction from DH Params structure (simple initialization).
- DHParams(DH*);
-
- ~DHParams();
-
- // Get the internal key structure as per the OpenSSL implementation.
- DH* get() const;
-
-private:
-
- DH* _dhParams;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DH_PARAMS_H +#define ICE_DH_PARAMS_H + +#include <IceUtil/Shared.h> +#include <IceSSL/DHParamsF.h> +#include <openssl/ssl.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class DHParams : public IceUtil::Shared +{ +public: + + // Construction from DH Params structure (simple initialization). + DHParams(DH*); + + ~DHParams(); + + // Get the internal key structure as per the OpenSSL implementation. + DH* get() const; + +private: + + DH* _dhParams; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/DHParamsF.h b/cpp/src/IceSSL/DHParamsF.h index b8b8274ec88..abe97b9f4e6 100644 --- a/cpp/src/IceSSL/DHParamsF.h +++ b/cpp/src/IceSSL/DHParamsF.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_DH_PARAMS_F_H
-#define ICE_DH_PARAMS_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class DHParams;
-typedef IceInternal::Handle<DHParams> DHParamsPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::OpenSSL::DHParams*);
-void decRef(::IceSSL::OpenSSL::DHParams*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DH_PARAMS_F_H +#define ICE_DH_PARAMS_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class DHParams; +typedef IceInternal::Handle<DHParams> DHParamsPtr; + +} + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::OpenSSL::DHParams*); +void decRef(::IceSSL::OpenSSL::DHParams*); + +} + +#endif diff --git a/cpp/src/IceSSL/DefaultCertificateVerifier.h b/cpp/src/IceSSL/DefaultCertificateVerifier.h index c465cd52be4..05e99716105 100644 --- a/cpp/src/IceSSL/DefaultCertificateVerifier.h +++ b/cpp/src/IceSSL/DefaultCertificateVerifier.h @@ -1,42 +1,42 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_DEFAULT_CERTIFICATE_VERIFIER_H
-#define ICE_SSL_DEFAULT_CERTIFICATE_VERIFIER_H
-
-#include <Ice/LoggerF.h>
-#include <IceSSL/TraceLevelsF.h>
-#include <IceSSL/CertificateVerifierOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class DefaultCertificateVerifier : public IceSSL::OpenSSL::CertificateVerifier
-{
-public:
-
- DefaultCertificateVerifier(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&);
-
- virtual int verify(int, X509_STORE_CTX*, SSL*);
-
-private:
-
- IceSSL::TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_DEFAULT_CERTIFICATE_VERIFIER_H +#define ICE_SSL_DEFAULT_CERTIFICATE_VERIFIER_H + +#include <Ice/LoggerF.h> +#include <IceSSL/TraceLevelsF.h> +#include <IceSSL/CertificateVerifierOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class DefaultCertificateVerifier : public IceSSL::OpenSSL::CertificateVerifier +{ +public: + + DefaultCertificateVerifier(const IceSSL::TraceLevelsPtr&, const Ice::LoggerPtr&); + + virtual int verify(int, X509_STORE_CTX*, SSL*); + +private: + + IceSSL::TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/GeneralConfig.h b/cpp/src/IceSSL/GeneralConfig.h index 967347adf29..c9bca2c9090 100644 --- a/cpp/src/IceSSL/GeneralConfig.h +++ b/cpp/src/IceSSL/GeneralConfig.h @@ -1,66 +1,66 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_GENERAL_CONFIG_H
-#define ICE_SSL_GENERAL_CONFIG_H
-
-#include <IceSSL/OpenSSL.h>
-
-namespace IceSSL
-{
-
-class GeneralConfig
-{
-public:
-
- GeneralConfig();
-
- SslProtocol getProtocol() const;
- int getVerifyMode() const;
- int getVerifyDepth() const;
-
- std::string getContext() const;
- std::string getCipherList() const;
- std::string getRandomBytesFiles() const;
-
- // General method - it will figure out how to properly parse the data.
- void set(std::string&, std::string&);
-
-protected:
-
- SslProtocol _sslVersion;
-
- int _verifyMode;
- int _verifyDepth;
-
- std::string _context;
- std::string _cipherList;
- std::string _randomBytesFiles;
-
- void parseVersion(std::string&);
- void parseVerifyMode(std::string&);
-};
-
-template<class Stream> inline
-Stream& operator << (Stream& target, const GeneralConfig& generalConfig)
-{
- target << "Protocol: " << generalConfig.getProtocol() << std::endl;
- target << "Verify Mode: " << generalConfig.getVerifyMode() << std::endl;
- target << "Verify Depth: " << generalConfig.getVerifyDepth() << std::endl;
- target << "Context: " << generalConfig.getContext() << std::endl;
- target << "Cipher List: " << generalConfig.getCipherList() << std::endl;
- target << "Random Bytes: " << generalConfig.getRandomBytesFiles() << std::endl;
-
- return target;
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_GENERAL_CONFIG_H +#define ICE_SSL_GENERAL_CONFIG_H + +#include <IceSSL/OpenSSL.h> + +namespace IceSSL +{ + +class GeneralConfig +{ +public: + + GeneralConfig(); + + SslProtocol getProtocol() const; + int getVerifyMode() const; + int getVerifyDepth() const; + + std::string getContext() const; + std::string getCipherList() const; + std::string getRandomBytesFiles() const; + + // General method - it will figure out how to properly parse the data. + void set(std::string&, std::string&); + +protected: + + SslProtocol _sslVersion; + + int _verifyMode; + int _verifyDepth; + + std::string _context; + std::string _cipherList; + std::string _randomBytesFiles; + + void parseVersion(std::string&); + void parseVerifyMode(std::string&); +}; + +template<class Stream> inline +Stream& operator << (Stream& target, const GeneralConfig& generalConfig) +{ + target << "Protocol: " << generalConfig.getProtocol() << std::endl; + target << "Verify Mode: " << generalConfig.getVerifyMode() << std::endl; + target << "Verify Depth: " << generalConfig.getVerifyDepth() << std::endl; + target << "Context: " << generalConfig.getContext() << std::endl; + target << "Cipher List: " << generalConfig.getCipherList() << std::endl; + target << "Random Bytes: " << generalConfig.getRandomBytesFiles() << std::endl; + + return target; +} + +} + +#endif diff --git a/cpp/src/IceSSL/OpenSSL.h b/cpp/src/IceSSL/OpenSSL.h index 463c036247d..978f2c85ce8 100644 --- a/cpp/src/IceSSL/OpenSSL.h +++ b/cpp/src/IceSSL/OpenSSL.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_OPENSSL_H
-#define ICE_OPENSSL_H
-
-#include <IceUtil/Config.h>
-#include <openssl/ssl.h>
-
-namespace IceSSL
-{
-
-typedef enum
-{
- NO_SECURITY_TRACE = 0,
- SECURITY_WARNINGS,
- SECURITY_PARSE_WARNINGS,
- SECURITY_PROTOCOL,
- SECURITY_PROTOCOL_DEBUG
-} SecurityTraceLevel;
-
-enum SslProtocol
-{
- SSL_V2 = 1, // Only speak SSLv2
- SSL_V23, // Speak SSLv2 and SSLv3
- SSL_V3, // Only speak SSLv3
- TLS_V1 // Only speak TLSv1
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_OPENSSL_H +#define ICE_OPENSSL_H + +#include <IceUtil/Config.h> +#include <openssl/ssl.h> + +namespace IceSSL +{ + +typedef enum +{ + NO_SECURITY_TRACE = 0, + SECURITY_WARNINGS, + SECURITY_PARSE_WARNINGS, + SECURITY_PROTOCOL, + SECURITY_PROTOCOL_DEBUG +} SecurityTraceLevel; + +enum SslProtocol +{ + SSL_V2 = 1, // Only speak SSLv2 + SSL_V23, // Speak SSLv2 and SSLv3 + SSL_V3, // Only speak SSLv3 + TLS_V1 // Only speak TLSv1 +}; + +} + +#endif diff --git a/cpp/src/IceSSL/OpenSSLJanitors.h b/cpp/src/IceSSL/OpenSSLJanitors.h index 1140d2bc6c7..63802ae50ba 100644 --- a/cpp/src/IceSSL/OpenSSLJanitors.h +++ b/cpp/src/IceSSL/OpenSSLJanitors.h @@ -1,102 +1,102 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_JANITORS_H
-#define ICE_SSL_JANITORS_H
-
-#include <IceUtil/Config.h>
-#include <openssl/ssl.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class RSAJanitor
-{
-public:
-
- RSAJanitor(RSA*);
- ~RSAJanitor();
-
- void clear();
- RSA* get() const;
-
-private:
-
- RSA* _rsa;
-};
-
-class EVP_PKEYJanitor
-{
-public:
-
- EVP_PKEYJanitor(EVP_PKEY*);
- ~EVP_PKEYJanitor();
-
- void clear();
- EVP_PKEY* get() const;
-
-private:
-
- EVP_PKEY* _evp_pkey;
-};
-
-class X509_REQJanitor
-{
-public:
-
- X509_REQJanitor(X509_REQ*);
- ~X509_REQJanitor();
-
- void clear();
- X509_REQ* get() const;
-
-private:
-
- X509_REQ* _x509_req;
-};
-
-class X509Janitor
-{
-public:
-
- X509Janitor(X509*);
- ~X509Janitor();
-
- void clear();
- X509* get() const;
-
-private:
-
- X509* _x509;
-};
-
-class BIOJanitor
-{
-public:
-
- BIOJanitor(BIO*);
- ~BIOJanitor();
-
- void clear();
- BIO* get() const;
-
-private:
-
- BIO* _bio;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_JANITORS_H +#define ICE_SSL_JANITORS_H + +#include <IceUtil/Config.h> +#include <openssl/ssl.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class RSAJanitor +{ +public: + + RSAJanitor(RSA*); + ~RSAJanitor(); + + void clear(); + RSA* get() const; + +private: + + RSA* _rsa; +}; + +class EVP_PKEYJanitor +{ +public: + + EVP_PKEYJanitor(EVP_PKEY*); + ~EVP_PKEYJanitor(); + + void clear(); + EVP_PKEY* get() const; + +private: + + EVP_PKEY* _evp_pkey; +}; + +class X509_REQJanitor +{ +public: + + X509_REQJanitor(X509_REQ*); + ~X509_REQJanitor(); + + void clear(); + X509_REQ* get() const; + +private: + + X509_REQ* _x509_req; +}; + +class X509Janitor +{ +public: + + X509Janitor(X509*); + ~X509Janitor(); + + void clear(); + X509* get() const; + +private: + + X509* _x509; +}; + +class BIOJanitor +{ +public: + + BIOJanitor(BIO*); + ~BIOJanitor(); + + void clear(); + BIO* get() const; + +private: + + BIO* _bio; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/OpenSSLPluginI.h b/cpp/src/IceSSL/OpenSSLPluginI.h index d18dfbe3e83..2aac3e8c179 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.h +++ b/cpp/src/IceSSL/OpenSSLPluginI.h @@ -1,118 +1,118 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_OPENSSL_PLUGIN_I_H
-#define ICE_SSL_OPENSSL_PLUGIN_I_H
-
-#include <IceUtil/RecMutex.h>
-#include <IceSSL/PluginBaseI.h>
-#include <IceSSL/CertificateDesc.h>
-#include <IceSSL/CertificateAuthority.h>
-#include <IceSSL/BaseCerts.h>
-#include <IceSSL/TempCerts.h>
-#include <IceSSL/ContextOpenSSLServer.h>
-#include <IceSSL/ContextOpenSSLClient.h>
-#include <IceSSL/RSAPrivateKeyF.h>
-#include <IceSSL/DHParamsF.h>
-#include <openssl/ssl.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-typedef std::map<int,RSAPrivateKeyPtr> RSAMap;
-typedef std::map<int,DHParamsPtr> DHMap;
-
-typedef std::map<int,CertificateDesc> RSACertMap;
-typedef std::map<int,DiffieHellmanParamsFile> DHParamsMap;
-
-class PluginI : public PluginBaseI
-{
-public:
-
- PluginI(const IceInternal::ProtocolPluginFacadePtr&);
- ~PluginI();
-
- virtual IceSSL::ConnectionPtr createConnection(ContextType, int);
-
- virtual bool isConfigured(ContextType);
- virtual void configure();
- virtual void configure(ContextType);
- virtual void loadConfig(ContextType, const std::string&, const std::string&);
-
- // Returns the desired RSA Key, or creates it if not already created.
- // This is public because the tmpRSACallback must be able to access it.
- RSA* getRSAKey(int, int);
-
- // Returns the desired DH Params. If the Params do not already exist, and the key
- // requested is a 512bit or 1024bit key, we use the compiled-in temporary params.
- // If the key is some other length, we read the desired key, based on length,
- // from a DH Param file.
- // This is public because the tmpDHCallback must be able to access it.
- DH* getDHParams(int, int);
-
- virtual void setCertificateVerifier(ContextType, const IceSSL::CertificateVerifierPtr&);
-
- virtual void addTrustedCertificateBase64(ContextType, const std::string&);
-
- virtual void addTrustedCertificate(ContextType, const Ice::ByteSeq&);
-
- virtual void setRSAKeysBase64(ContextType, const std::string&, const std::string&);
-
- virtual void setRSAKeys(ContextType, const Ice::ByteSeq&, const Ice::ByteSeq&);
-
- virtual IceSSL::CertificateVerifierPtr getDefaultCertVerifier();
-
- virtual IceSSL::CertificateVerifierPtr getSingleCertVerifier(const Ice::ByteSeq&);
-
- virtual void destroy();
-
-private:
-
- ServerContext _serverContext;
- ClientContext _clientContext;
-
- // Mutex to ensure synchronization of calls to configure
- // the contexts and calls to create connections.
- IceUtil::RecMutex _configMutex;
-
- // Keep a cache of all temporary RSA keys.
- RSAMap _tempRSAKeys;
- IceUtil::Mutex _tempRSAKeysMutex;
-
- // Keep a cache of all temporary Diffie-Hellman keys.
- DHMap _tempDHKeys;
- IceUtil::Mutex _tempDHKeysMutex;
-
- // Maps of all temporary keying information.
- // The files themselves will not be loaded until
- // needed.
- RSACertMap _tempRSAFileMap;
- DHParamsMap _tempDHParamsFileMap;
-
- // Flag as to whether the Random Number system has been seeded.
- int _randSeeded;
-
- // Cryptographic Random Number System related routines.
- int seedRand();
- long loadRandFiles(const std::string&);
- void initRandSystem(const std::string&);
-
- // Load the temporary (ephemeral) certificates for Server operations.
- void loadTempCerts(TempCertificates&);
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_OPENSSL_PLUGIN_I_H +#define ICE_SSL_OPENSSL_PLUGIN_I_H + +#include <IceUtil/RecMutex.h> +#include <IceSSL/PluginBaseI.h> +#include <IceSSL/CertificateDesc.h> +#include <IceSSL/CertificateAuthority.h> +#include <IceSSL/BaseCerts.h> +#include <IceSSL/TempCerts.h> +#include <IceSSL/ContextOpenSSLServer.h> +#include <IceSSL/ContextOpenSSLClient.h> +#include <IceSSL/RSAPrivateKeyF.h> +#include <IceSSL/DHParamsF.h> +#include <openssl/ssl.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +typedef std::map<int,RSAPrivateKeyPtr> RSAMap; +typedef std::map<int,DHParamsPtr> DHMap; + +typedef std::map<int,CertificateDesc> RSACertMap; +typedef std::map<int,DiffieHellmanParamsFile> DHParamsMap; + +class PluginI : public PluginBaseI +{ +public: + + PluginI(const IceInternal::ProtocolPluginFacadePtr&); + ~PluginI(); + + virtual IceSSL::ConnectionPtr createConnection(ContextType, int); + + virtual bool isConfigured(ContextType); + virtual void configure(); + virtual void configure(ContextType); + virtual void loadConfig(ContextType, const std::string&, const std::string&); + + // Returns the desired RSA Key, or creates it if not already created. + // This is public because the tmpRSACallback must be able to access it. + RSA* getRSAKey(int, int); + + // Returns the desired DH Params. If the Params do not already exist, and the key + // requested is a 512bit or 1024bit key, we use the compiled-in temporary params. + // If the key is some other length, we read the desired key, based on length, + // from a DH Param file. + // This is public because the tmpDHCallback must be able to access it. + DH* getDHParams(int, int); + + virtual void setCertificateVerifier(ContextType, const IceSSL::CertificateVerifierPtr&); + + virtual void addTrustedCertificateBase64(ContextType, const std::string&); + + virtual void addTrustedCertificate(ContextType, const Ice::ByteSeq&); + + virtual void setRSAKeysBase64(ContextType, const std::string&, const std::string&); + + virtual void setRSAKeys(ContextType, const Ice::ByteSeq&, const Ice::ByteSeq&); + + virtual IceSSL::CertificateVerifierPtr getDefaultCertVerifier(); + + virtual IceSSL::CertificateVerifierPtr getSingleCertVerifier(const Ice::ByteSeq&); + + virtual void destroy(); + +private: + + ServerContext _serverContext; + ClientContext _clientContext; + + // Mutex to ensure synchronization of calls to configure + // the contexts and calls to create connections. + IceUtil::RecMutex _configMutex; + + // Keep a cache of all temporary RSA keys. + RSAMap _tempRSAKeys; + IceUtil::Mutex _tempRSAKeysMutex; + + // Keep a cache of all temporary Diffie-Hellman keys. + DHMap _tempDHKeys; + IceUtil::Mutex _tempDHKeysMutex; + + // Maps of all temporary keying information. + // The files themselves will not be loaded until + // needed. + RSACertMap _tempRSAFileMap; + DHParamsMap _tempDHParamsFileMap; + + // Flag as to whether the Random Number system has been seeded. + int _randSeeded; + + // Cryptographic Random Number System related routines. + int seedRand(); + long loadRandFiles(const std::string&); + void initRandSystem(const std::string&); + + // Load the temporary (ephemeral) certificates for Server operations. + void loadTempCerts(TempCertificates&); +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/OpenSSLUtils.h b/cpp/src/IceSSL/OpenSSLUtils.h index 7dc57afee56..9e75f8fac02 100644 --- a/cpp/src/IceSSL/OpenSSLUtils.h +++ b/cpp/src/IceSSL/OpenSSLUtils.h @@ -1,52 +1,52 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#include <IceUtil/Config.h>
-#include <openssl/ssl.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-std::string getGeneralizedTime(ASN1_GENERALIZEDTIME*);
-
-std::string getUTCTime(ASN1_UTCTIME*);
-
-std::string getASN1time(ASN1_TIME*);
-
-DH* loadDHParam(const char*);
-
-DH* getTempDH(unsigned char*, int, unsigned char*, int);
-
-DH* getTempDH512();
-DH* getTempDH1024();
-DH* getTempDH2048();
-DH* getTempDH4096();
-
-std::string sslGetErrors();
-
-}
-
-}
-
-extern "C"
-{
-
-RSA* tmpRSACallback(SSL*, int, int);
-
-DH* tmpDHCallback(SSL*, int, int);
-
-int verifyCallback(int, X509_STORE_CTX*);
-
-int passwordCallback(char*, int, int, void*);
-
-}
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <IceUtil/Config.h> +#include <openssl/ssl.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +std::string getGeneralizedTime(ASN1_GENERALIZEDTIME*); + +std::string getUTCTime(ASN1_UTCTIME*); + +std::string getASN1time(ASN1_TIME*); + +DH* loadDHParam(const char*); + +DH* getTempDH(unsigned char*, int, unsigned char*, int); + +DH* getTempDH512(); +DH* getTempDH1024(); +DH* getTempDH2048(); +DH* getTempDH4096(); + +std::string sslGetErrors(); + +} + +} + +extern "C" +{ + +RSA* tmpRSACallback(SSL*, int, int); + +DH* tmpDHCallback(SSL*, int, int); + +int verifyCallback(int, X509_STORE_CTX*); + +int passwordCallback(char*, int, int, void*); + +} diff --git a/cpp/src/IceSSL/PluginBaseI.h b/cpp/src/IceSSL/PluginBaseI.h index 9f9a180003d..42b6a6d1aa2 100644 --- a/cpp/src/IceSSL/PluginBaseI.h +++ b/cpp/src/IceSSL/PluginBaseI.h @@ -1,71 +1,71 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_PLUGIN_I_H
-#define ICE_SSL_PLUGIN_I_H
-
-#include <Ice/LoggerF.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/ProtocolPluginFacadeF.h>
-#include <IceSSL/Plugin.h>
-#include <IceSSL/PluginBaseIF.h>
-#include <IceSSL/SslConnectionF.h>
-#include <IceSSL/CertificateVerifierF.h>
-#include <IceSSL/TraceLevelsF.h>
-
-namespace IceSSL
-{
-
-class PluginBaseI : public IceSSL::Plugin
-{
-public:
-
- virtual ConnectionPtr createConnection(ContextType, int) = 0;
-
- virtual bool isConfigured(ContextType) = 0;
-
- virtual void configure() = 0;
-
- virtual void configure(ContextType) = 0;
-
- virtual void loadConfig(ContextType, const ::std::string&, const ::std::string&) = 0;
-
- virtual void setCertificateVerifier(ContextType, const CertificateVerifierPtr&) = 0;
-
- virtual void addTrustedCertificateBase64(ContextType, const std::string&) = 0;
-
- virtual void addTrustedCertificate(ContextType, const Ice::ByteSeq&) = 0;
-
- virtual void setRSAKeysBase64(ContextType, const std::string&, const std::string&) = 0;
-
- virtual void setRSAKeys(ContextType, const ::Ice::ByteSeq&, const ::Ice::ByteSeq&) = 0;
-
- TraceLevelsPtr getTraceLevels() const;
-
- Ice::LoggerPtr getLogger() const;
-
- Ice::PropertiesPtr getProperties() const;
-
- IceInternal::ProtocolPluginFacadePtr getProtocolPluginFacade() const;
-
-protected:
-
- PluginBaseI(const IceInternal::ProtocolPluginFacadePtr&);
- virtual ~PluginBaseI();
-
- IceInternal::ProtocolPluginFacadePtr _protocolPluginFacade;
- TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
- Ice::PropertiesPtr _properties;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_PLUGIN_I_H +#define ICE_SSL_PLUGIN_I_H + +#include <Ice/LoggerF.h> +#include <Ice/PropertiesF.h> +#include <Ice/ProtocolPluginFacadeF.h> +#include <IceSSL/Plugin.h> +#include <IceSSL/PluginBaseIF.h> +#include <IceSSL/SslConnectionF.h> +#include <IceSSL/CertificateVerifierF.h> +#include <IceSSL/TraceLevelsF.h> + +namespace IceSSL +{ + +class PluginBaseI : public IceSSL::Plugin +{ +public: + + virtual ConnectionPtr createConnection(ContextType, int) = 0; + + virtual bool isConfigured(ContextType) = 0; + + virtual void configure() = 0; + + virtual void configure(ContextType) = 0; + + virtual void loadConfig(ContextType, const ::std::string&, const ::std::string&) = 0; + + virtual void setCertificateVerifier(ContextType, const CertificateVerifierPtr&) = 0; + + virtual void addTrustedCertificateBase64(ContextType, const std::string&) = 0; + + virtual void addTrustedCertificate(ContextType, const Ice::ByteSeq&) = 0; + + virtual void setRSAKeysBase64(ContextType, const std::string&, const std::string&) = 0; + + virtual void setRSAKeys(ContextType, const ::Ice::ByteSeq&, const ::Ice::ByteSeq&) = 0; + + TraceLevelsPtr getTraceLevels() const; + + Ice::LoggerPtr getLogger() const; + + Ice::PropertiesPtr getProperties() const; + + IceInternal::ProtocolPluginFacadePtr getProtocolPluginFacade() const; + +protected: + + PluginBaseI(const IceInternal::ProtocolPluginFacadePtr&); + virtual ~PluginBaseI(); + + IceInternal::ProtocolPluginFacadePtr _protocolPluginFacade; + TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + Ice::PropertiesPtr _properties; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/PluginBaseIF.h b/cpp/src/IceSSL/PluginBaseIF.h index e145fe32230..1f7cf16bd6e 100644 --- a/cpp/src/IceSSL/PluginBaseIF.h +++ b/cpp/src/IceSSL/PluginBaseIF.h @@ -1,32 +1,32 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_PLUGIN_BASE_I_F_H
-#define ICE_SSL_PLUGIN_BASE_I_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-class PluginBaseI;
-typedef IceInternal::Handle<PluginBaseI> PluginBaseIPtr;
-
-}
-
-namespace IceInternal
-{
-
-void incRef(IceSSL::PluginBaseI*);
-void decRef(IceSSL::PluginBaseI*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_PLUGIN_BASE_I_F_H +#define ICE_SSL_PLUGIN_BASE_I_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +class PluginBaseI; +typedef IceInternal::Handle<PluginBaseI> PluginBaseIPtr; + +} + +namespace IceInternal +{ + +void incRef(IceSSL::PluginBaseI*); +void decRef(IceSSL::PluginBaseI*); + +} + +#endif diff --git a/cpp/src/IceSSL/SingleCertificateVerifier.h b/cpp/src/IceSSL/SingleCertificateVerifier.h index c524311c119..89753b620e9 100644 --- a/cpp/src/IceSSL/SingleCertificateVerifier.h +++ b/cpp/src/IceSSL/SingleCertificateVerifier.h @@ -1,43 +1,43 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_SINGLE_CERTIFICATE_VERIFIER_H
-#define ICE_SSL_SINGLE_CERTIFICATE_VERIFIER_H
-
-#include <Ice/BuiltinSequences.h>
-#include <IceSSL/CertificateVerifierOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class SingleCertificateVerifier : public IceSSL::OpenSSL::CertificateVerifier
-{
-public:
-
- SingleCertificateVerifier(const Ice::ByteSeq&);
-
- virtual int verify(int, X509_STORE_CTX*, SSL*);
-
- Ice::ByteSeq toByteSeq(X509*);
-
-protected:
-
- Ice::ByteSeq _publicKey;
-};
-
-}
-
-}
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_SINGLE_CERTIFICATE_VERIFIER_H +#define ICE_SSL_SINGLE_CERTIFICATE_VERIFIER_H + +#include <Ice/BuiltinSequences.h> +#include <IceSSL/CertificateVerifierOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class SingleCertificateVerifier : public IceSSL::OpenSSL::CertificateVerifier +{ +public: + + SingleCertificateVerifier(const Ice::ByteSeq&); + + virtual int verify(int, X509_STORE_CTX*, SSL*); + + Ice::ByteSeq toByteSeq(X509*); + +protected: + + Ice::ByteSeq _publicKey; +}; + +} + +} + +#endif + diff --git a/cpp/src/IceSSL/SslAcceptor.h b/cpp/src/IceSSL/SslAcceptor.h index dbe7656e840..5718d5ab3c9 100644 --- a/cpp/src/IceSSL/SslAcceptor.h +++ b/cpp/src/IceSSL/SslAcceptor.h @@ -1,58 +1,58 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_ACCEPTOR_H
-#define ICE_SSL_ACCEPTOR_H
-
-#include <Ice/TransceiverF.h>
-#include <Ice/LoggerF.h>
-#include <Ice/Acceptor.h>
-#include <IceSSL/PluginBaseIF.h>
-#include <IceSSL/TraceLevelsF.h>
-
-#ifndef _WIN32
-# include <netinet/in.h> // For struct sockaddr_in
-#endif
-
-namespace IceSSL
-{
-
-class SslEndpoint;
-
-class SslAcceptor : public IceInternal::Acceptor
-{
-public:
-
- virtual SOCKET fd();
- virtual void close();
- virtual void listen();
- virtual IceInternal::TransceiverPtr accept(int);
- virtual std::string toString() const;
-
- bool equivalent(const std::string&, int) const;
- int effectivePort();
-
-private:
-
- SslAcceptor(const PluginBaseIPtr&, const std::string&, int);
- virtual ~SslAcceptor();
- friend class SslEndpoint;
-
- PluginBaseIPtr _plugin;
- TraceLevelsPtr _traceLevels;
- ::Ice::LoggerPtr _logger;
- SOCKET _fd;
- int _backlog;
- struct sockaddr_in _addr;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_ACCEPTOR_H +#define ICE_SSL_ACCEPTOR_H + +#include <Ice/TransceiverF.h> +#include <Ice/LoggerF.h> +#include <Ice/Acceptor.h> +#include <IceSSL/PluginBaseIF.h> +#include <IceSSL/TraceLevelsF.h> + +#ifndef _WIN32 +# include <netinet/in.h> // For struct sockaddr_in +#endif + +namespace IceSSL +{ + +class SslEndpoint; + +class SslAcceptor : public IceInternal::Acceptor +{ +public: + + virtual SOCKET fd(); + virtual void close(); + virtual void listen(); + virtual IceInternal::TransceiverPtr accept(int); + virtual std::string toString() const; + + bool equivalent(const std::string&, int) const; + int effectivePort(); + +private: + + SslAcceptor(const PluginBaseIPtr&, const std::string&, int); + virtual ~SslAcceptor(); + friend class SslEndpoint; + + PluginBaseIPtr _plugin; + TraceLevelsPtr _traceLevels; + ::Ice::LoggerPtr _logger; + SOCKET _fd; + int _backlog; + struct sockaddr_in _addr; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnection.h b/cpp/src/IceSSL/SslConnection.h index 8347f7893bf..eb7aedb9e7f 100644 --- a/cpp/src/IceSSL/SslConnection.h +++ b/cpp/src/IceSSL/SslConnection.h @@ -1,46 +1,46 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_H
-#define ICE_SSL_CONNECTION_H
-
-#include <Ice/Buffer.h>
-#include <Ice/LoggerF.h>
-#include <IceSSL/SslConnectionF.h>
-#include <IceSSL/TraceLevelsF.h>
-#include <IceSSL/CertificateVerifierF.h>
-
-namespace IceSSL
-{
-
-class Connection : public IceUtil::Shared
-{
-public:
-
- Connection(const TraceLevelsPtr&,
- const Ice::LoggerPtr&,
- const CertificateVerifierPtr&);
- virtual ~Connection();
-
- virtual int shutdown(int timeout = 0) = 0;
-
- virtual int read(IceInternal::Buffer&, int) = 0;
- virtual int write(IceInternal::Buffer&, int) = 0;
-
-protected:
-
- TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
- CertificateVerifierPtr _certificateVerifier;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_H +#define ICE_SSL_CONNECTION_H + +#include <Ice/Buffer.h> +#include <Ice/LoggerF.h> +#include <IceSSL/SslConnectionF.h> +#include <IceSSL/TraceLevelsF.h> +#include <IceSSL/CertificateVerifierF.h> + +namespace IceSSL +{ + +class Connection : public IceUtil::Shared +{ +public: + + Connection(const TraceLevelsPtr&, + const Ice::LoggerPtr&, + const CertificateVerifierPtr&); + virtual ~Connection(); + + virtual int shutdown(int timeout = 0) = 0; + + virtual int read(IceInternal::Buffer&, int) = 0; + virtual int write(IceInternal::Buffer&, int) = 0; + +protected: + + TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + CertificateVerifierPtr _certificateVerifier; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnectionF.h b/cpp/src/IceSSL/SslConnectionF.h index 48c4383448f..5d394788405 100644 --- a/cpp/src/IceSSL/SslConnectionF.h +++ b/cpp/src/IceSSL/SslConnectionF.h @@ -1,32 +1,32 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_F_H
-#define ICE_SSL_CONNECTION_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-class Connection;
-typedef IceInternal::Handle<Connection> ConnectionPtr;
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::Connection*);
-void decRef(::IceSSL::Connection*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_F_H +#define ICE_SSL_CONNECTION_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +class Connection; +typedef IceInternal::Handle<Connection> ConnectionPtr; + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::Connection*); +void decRef(::IceSSL::Connection*); + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnectionOpenSSL.h b/cpp/src/IceSSL/SslConnectionOpenSSL.h index 6cf2a501b4b..b7ae891f86b 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSL.h +++ b/cpp/src/IceSSL/SslConnectionOpenSSL.h @@ -1,206 +1,206 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_OPENSSL_H
-#define ICE_SSL_CONNECTION_OPENSSL_H
-
-#include <IceUtil/Mutex.h>
-#include <IceSSL/SslConnection.h>
-#include <IceSSL/PluginBaseIF.h>
-#include <IceSSL/SslConnectionOpenSSLF.h>
-#include <IceSSL/CertificateVerifierOpenSSL.h>
-#include <IceSSL/TraceLevelsF.h>
-
-#include <openssl/ssl.h>
-
-#include <map>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class SafeFlag
-{
-public:
-
- SafeFlag(bool flagVal = false)
- {
- _flag = flagVal;
- }
-
- ~SafeFlag()
- {
- }
-
- bool checkAndSet()
- {
- IceUtil::Mutex::Lock sync(_mutex);
-
- if(_flag)
- {
- return false;
- }
- else
- {
- _flag = true;
- return true;
- }
- }
-
- bool check()
- {
- IceUtil::Mutex::Lock sync(_mutex);
- return _flag;
- }
-
- void set()
- {
- IceUtil::Mutex::Lock sync(_mutex);
- _flag = true;
- }
-
- void unset()
- {
- IceUtil::Mutex::Lock sync(_mutex);
- _flag = false;
- }
-
-private:
-
- IceUtil::Mutex _mutex;
- bool _flag;
-};
-
-class HandshakeSentinel
-{
-public:
-
- HandshakeSentinel(SafeFlag& handshakeFlag) :
- _flag(handshakeFlag)
- {
- _ownHandshake = _flag.checkAndSet();
- }
-
- ~HandshakeSentinel()
- {
- if(_ownHandshake)
- {
- _flag.unset();
- }
- }
-
- bool ownHandshake()
- {
- return _ownHandshake;
- }
-
-private:
-
- bool _ownHandshake;
- SafeFlag& _flag;
-};
-
-// NOTE: This is a mapping from SSL* to Connection*, for use with the verifyCallback.
-// I have purposely not used ConnectionPtr here, as connections register themselves
-// with this map on construction and unregister themselves in the destructor. If
-// this map used ConnectionPtr, Connection instances would never destruct as there
-// would always be a reference to them from the map.
-typedef std::map<SSL*, Connection*> SslConnectionMap;
-
-typedef enum
-{
- Handshake, // The connection is negotiating a connection with the peer.
- Shutdown, // The connection is in the process of shutting down.
- Connected // The connection is connected - communication may continue.
-} ConnectPhase;
-
-class Connection : public IceSSL::Connection
-{
-public:
-
- Connection(const IceSSL::CertificateVerifierPtr&,
- SSL*,
- const IceSSL::PluginBaseIPtr&);
- virtual ~Connection();
-
- virtual int shutdown(int timeout = 0);
-
- virtual int read(IceInternal::Buffer&, int);
- virtual int write(IceInternal::Buffer&, int) = 0;
-
- virtual int handshake(int timeout = 0) = 0;
-
- void setHandshakeReadTimeout(int timeout);
-
- static ConnectionPtr getConnection(SSL*);
-
- // Callback from OpenSSL for purposes of certificate verification
- int verifyCertificate(int, X509_STORE_CTX*);
-
-protected:
-
- int connect();
- int accept();
- int renegotiate();
- int initialize(int timeout);
-
- int pending();
- int getLastError() const;
-
- int sslRead(char*, int);
- int sslWrite(char*, int);
-
- int select(int, bool);
- int readSelect(int);
- int writeSelect(int);
-
- int readSSL(IceInternal::Buffer&, int);
-
- static void addConnection(SSL*, Connection*);
- static void removeConnection(SSL*);
-
- virtual void showConnectionInfo() = 0;
-
- void showCertificateChain(BIO*);
- void showPeerCertificate(BIO*, const char*);
- void showSharedCiphers(BIO*);
- void showSessionInfo(BIO*);
- void showSelectedCipherInfo(BIO*);
- void showHandshakeStats(BIO*);
- void showClientCAList(BIO*, const char*);
-
- void setLastError(int errorCode) { _lastError = errorCode; };
-
- static SslConnectionMap _connectionMap;
- static IceUtil::Mutex _connectionRepositoryMutex;
-
- // Pointer to the OpenSSL Connection structure.
- SSL* _sslConnection;
-
- int _lastError;
-
- IceUtil::Mutex _handshakeWaitMutex;
-
- SafeFlag _handshakeFlag;
- int _initWantRead;
- int _initWantWrite;
- int _handshakeReadTimeout;
- int _readTimeout;
-
- ConnectPhase _phase;
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_OPENSSL_H +#define ICE_SSL_CONNECTION_OPENSSL_H + +#include <IceUtil/Mutex.h> +#include <IceSSL/SslConnection.h> +#include <IceSSL/PluginBaseIF.h> +#include <IceSSL/SslConnectionOpenSSLF.h> +#include <IceSSL/CertificateVerifierOpenSSL.h> +#include <IceSSL/TraceLevelsF.h> + +#include <openssl/ssl.h> + +#include <map> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class SafeFlag +{ +public: + + SafeFlag(bool flagVal = false) + { + _flag = flagVal; + } + + ~SafeFlag() + { + } + + bool checkAndSet() + { + IceUtil::Mutex::Lock sync(_mutex); + + if(_flag) + { + return false; + } + else + { + _flag = true; + return true; + } + } + + bool check() + { + IceUtil::Mutex::Lock sync(_mutex); + return _flag; + } + + void set() + { + IceUtil::Mutex::Lock sync(_mutex); + _flag = true; + } + + void unset() + { + IceUtil::Mutex::Lock sync(_mutex); + _flag = false; + } + +private: + + IceUtil::Mutex _mutex; + bool _flag; +}; + +class HandshakeSentinel +{ +public: + + HandshakeSentinel(SafeFlag& handshakeFlag) : + _flag(handshakeFlag) + { + _ownHandshake = _flag.checkAndSet(); + } + + ~HandshakeSentinel() + { + if(_ownHandshake) + { + _flag.unset(); + } + } + + bool ownHandshake() + { + return _ownHandshake; + } + +private: + + bool _ownHandshake; + SafeFlag& _flag; +}; + +// NOTE: This is a mapping from SSL* to Connection*, for use with the verifyCallback. +// I have purposely not used ConnectionPtr here, as connections register themselves +// with this map on construction and unregister themselves in the destructor. If +// this map used ConnectionPtr, Connection instances would never destruct as there +// would always be a reference to them from the map. +typedef std::map<SSL*, Connection*> SslConnectionMap; + +typedef enum +{ + Handshake, // The connection is negotiating a connection with the peer. + Shutdown, // The connection is in the process of shutting down. + Connected // The connection is connected - communication may continue. +} ConnectPhase; + +class Connection : public IceSSL::Connection +{ +public: + + Connection(const IceSSL::CertificateVerifierPtr&, + SSL*, + const IceSSL::PluginBaseIPtr&); + virtual ~Connection(); + + virtual int shutdown(int timeout = 0); + + virtual int read(IceInternal::Buffer&, int); + virtual int write(IceInternal::Buffer&, int) = 0; + + virtual int handshake(int timeout = 0) = 0; + + void setHandshakeReadTimeout(int timeout); + + static ConnectionPtr getConnection(SSL*); + + // Callback from OpenSSL for purposes of certificate verification + int verifyCertificate(int, X509_STORE_CTX*); + +protected: + + int connect(); + int accept(); + int renegotiate(); + int initialize(int timeout); + + int pending(); + int getLastError() const; + + int sslRead(char*, int); + int sslWrite(char*, int); + + int select(int, bool); + int readSelect(int); + int writeSelect(int); + + int readSSL(IceInternal::Buffer&, int); + + static void addConnection(SSL*, Connection*); + static void removeConnection(SSL*); + + virtual void showConnectionInfo() = 0; + + void showCertificateChain(BIO*); + void showPeerCertificate(BIO*, const char*); + void showSharedCiphers(BIO*); + void showSessionInfo(BIO*); + void showSelectedCipherInfo(BIO*); + void showHandshakeStats(BIO*); + void showClientCAList(BIO*, const char*); + + void setLastError(int errorCode) { _lastError = errorCode; }; + + static SslConnectionMap _connectionMap; + static IceUtil::Mutex _connectionRepositoryMutex; + + // Pointer to the OpenSSL Connection structure. + SSL* _sslConnection; + + int _lastError; + + IceUtil::Mutex _handshakeWaitMutex; + + SafeFlag _handshakeFlag; + int _initWantRead; + int _initWantWrite; + int _handshakeReadTimeout; + int _readTimeout; + + ConnectPhase _phase; +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnectionOpenSSLClient.h b/cpp/src/IceSSL/SslConnectionOpenSSLClient.h index 988bd20411e..89903e5c8a8 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSLClient.h +++ b/cpp/src/IceSSL/SslConnectionOpenSSLClient.h @@ -1,44 +1,44 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_OPENSSL_CLIENT_H
-#define ICE_SSL_CONNECTION_OPENSSL_CLIENT_H
-
-#include <IceSSL/SslConnectionOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ClientConnection : public Connection
-{
-public:
-
- ClientConnection(const IceSSL::CertificateVerifierPtr&,
- SSL*,
- const IceSSL::PluginBaseIPtr&);
- virtual ~ClientConnection();
-
- virtual int handshake(int timeout = 0);
-
- virtual int write(IceInternal::Buffer&, int);
-
-protected:
-
- virtual void showConnectionInfo();
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_OPENSSL_CLIENT_H +#define ICE_SSL_CONNECTION_OPENSSL_CLIENT_H + +#include <IceSSL/SslConnectionOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ClientConnection : public Connection +{ +public: + + ClientConnection(const IceSSL::CertificateVerifierPtr&, + SSL*, + const IceSSL::PluginBaseIPtr&); + virtual ~ClientConnection(); + + virtual int handshake(int timeout = 0); + + virtual int write(IceInternal::Buffer&, int); + +protected: + + virtual void showConnectionInfo(); +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnectionOpenSSLF.h b/cpp/src/IceSSL/SslConnectionOpenSSLF.h index b5fb778de64..4c35b8166a3 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSLF.h +++ b/cpp/src/IceSSL/SslConnectionOpenSSLF.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_OPENSSL_F_H
-#define ICE_SSL_CONNECTION_OPENSSL_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class Connection;
-typedef IceInternal::Handle<Connection> ConnectionPtr;
-
-}
-
-}
-
-namespace IceInternal
-{
-
-void incRef(::IceSSL::OpenSSL::Connection*);
-void decRef(::IceSSL::OpenSSL::Connection*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_OPENSSL_F_H +#define ICE_SSL_CONNECTION_OPENSSL_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class Connection; +typedef IceInternal::Handle<Connection> ConnectionPtr; + +} + +} + +namespace IceInternal +{ + +void incRef(::IceSSL::OpenSSL::Connection*); +void decRef(::IceSSL::OpenSSL::Connection*); + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnectionOpenSSLServer.h b/cpp/src/IceSSL/SslConnectionOpenSSLServer.h index 6e1b91a524b..fb990670f68 100644 --- a/cpp/src/IceSSL/SslConnectionOpenSSLServer.h +++ b/cpp/src/IceSSL/SslConnectionOpenSSLServer.h @@ -1,44 +1,44 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTION_OPENSSL_SERVER_H
-#define ICE_SSL_CONNECTION_OPENSSL_SERVER_H
-
-#include <IceSSL/SslConnectionOpenSSL.h>
-
-namespace IceSSL
-{
-
-namespace OpenSSL
-{
-
-class ServerConnection : public Connection
-{
-public:
-
- ServerConnection(const IceSSL::CertificateVerifierPtr&,
- SSL*,
- const IceSSL::PluginBaseIPtr&);
- virtual ~ServerConnection();
-
- virtual int handshake(int timeout = 0);
-
- virtual int write(IceInternal::Buffer&, int);
-
-protected:
-
- virtual void showConnectionInfo();
-};
-
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTION_OPENSSL_SERVER_H +#define ICE_SSL_CONNECTION_OPENSSL_SERVER_H + +#include <IceSSL/SslConnectionOpenSSL.h> + +namespace IceSSL +{ + +namespace OpenSSL +{ + +class ServerConnection : public Connection +{ +public: + + ServerConnection(const IceSSL::CertificateVerifierPtr&, + SSL*, + const IceSSL::PluginBaseIPtr&); + virtual ~ServerConnection(); + + virtual int handshake(int timeout = 0); + + virtual int write(IceInternal::Buffer&, int); + +protected: + + virtual void showConnectionInfo(); +}; + +} + +} + +#endif diff --git a/cpp/src/IceSSL/SslConnector.h b/cpp/src/IceSSL/SslConnector.h index 7514abcc82b..de556f0e3ba 100644 --- a/cpp/src/IceSSL/SslConnector.h +++ b/cpp/src/IceSSL/SslConnector.h @@ -1,46 +1,46 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_CONNECTOR_H
-#define ICE_SSL_CONNECTOR_H
-
-#include <Ice/TransceiverF.h>
-#include <Ice/Connector.h>
-#include <IceSSL/PluginBaseIF.h>
-
-#ifndef _WIN32
-# include <netinet/in.h> // For struct sockaddr_in
-#endif
-
-namespace IceSSL
-{
-
-class SslEndpoint;
-
-class SslConnector : public IceInternal::Connector
-{
-public:
-
- virtual IceInternal::TransceiverPtr connect(int);
- virtual std::string toString() const;
-
-private:
-
- SslConnector(const PluginBaseIPtr&, const std::string&, int);
- virtual ~SslConnector();
- friend class SslEndpoint;
-
- PluginBaseIPtr _plugin;
- struct sockaddr_in _addr;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_CONNECTOR_H +#define ICE_SSL_CONNECTOR_H + +#include <Ice/TransceiverF.h> +#include <Ice/Connector.h> +#include <IceSSL/PluginBaseIF.h> + +#ifndef _WIN32 +# include <netinet/in.h> // For struct sockaddr_in +#endif + +namespace IceSSL +{ + +class SslEndpoint; + +class SslConnector : public IceInternal::Connector +{ +public: + + virtual IceInternal::TransceiverPtr connect(int); + virtual std::string toString() const; + +private: + + SslConnector(const PluginBaseIPtr&, const std::string&, int); + virtual ~SslConnector(); + friend class SslEndpoint; + + PluginBaseIPtr _plugin; + struct sockaddr_in _addr; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/SslEndpoint.h b/cpp/src/IceSSL/SslEndpoint.h index 4f2c4303737..308f4b072db 100644 --- a/cpp/src/IceSSL/SslEndpoint.h +++ b/cpp/src/IceSSL/SslEndpoint.h @@ -1,81 +1,81 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_ENDPOINT_H
-#define ICE_SSL_ENDPOINT_H
-
-#include <Ice/Endpoint.h>
-#include <Ice/EndpointFactory.h>
-#include <IceSSL/PluginBaseI.h>
-
-namespace IceSSL
-{
-
-const ::Ice::Short SslEndpointType = 2;
-
-class SslEndpoint : public IceInternal::Endpoint
-{
-public:
-
- SslEndpoint(const IceSSL::PluginBaseIPtr&, const std::string&, ::Ice::Int, ::Ice::Int);
- SslEndpoint(const IceSSL::PluginBaseIPtr&, const std::string&);
- SslEndpoint(const IceSSL::PluginBaseIPtr&, IceInternal::BasicStream*);
-
- virtual void streamWrite(IceInternal::BasicStream*) const;
- virtual std::string toString() const;
- virtual ::Ice::Short type() const;
- virtual ::Ice::Int timeout() const;
- virtual IceInternal::EndpointPtr timeout(::Ice::Int) const;
- virtual bool datagram() const;
- virtual bool secure() const;
- virtual bool unknown() const;
- virtual IceInternal::TransceiverPtr clientTransceiver() const;
- virtual IceInternal::TransceiverPtr serverTransceiver(IceInternal::EndpointPtr&) const;
- virtual IceInternal::ConnectorPtr connector() const;
- virtual IceInternal::AcceptorPtr acceptor(IceInternal::EndpointPtr&) const;
- virtual bool equivalent(const IceInternal::TransceiverPtr&) const;
- virtual bool equivalent(const IceInternal::AcceptorPtr&) const;
-
- virtual bool operator==(const IceInternal::Endpoint&) const;
- virtual bool operator!=(const IceInternal::Endpoint&) const;
- virtual bool operator<(const IceInternal::Endpoint&) const;
-
-private:
-
- //
- // All members are const, because endpoints are immutable.
- //
- const IceSSL::PluginBaseIPtr _plugin;
- const std::string _host;
- const ::Ice::Int _port;
- const ::Ice::Int _timeout;
-};
-
-class SslEndpointFactory : public IceInternal::EndpointFactory
-{
-public:
-
- SslEndpointFactory(const IceSSL::PluginBaseIPtr&);
- virtual ~SslEndpointFactory();
-
- virtual ::Ice::Short type() const;
- virtual const ::std::string& protocol() const;
- virtual IceInternal::EndpointPtr create(const std::string&) const;
- virtual IceInternal::EndpointPtr read(IceInternal::BasicStream*) const;
- virtual void destroy();
-
-private:
-
- IceSSL::PluginBaseIPtr _plugin;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_ENDPOINT_H +#define ICE_SSL_ENDPOINT_H + +#include <Ice/Endpoint.h> +#include <Ice/EndpointFactory.h> +#include <IceSSL/PluginBaseI.h> + +namespace IceSSL +{ + +const ::Ice::Short SslEndpointType = 2; + +class SslEndpoint : public IceInternal::Endpoint +{ +public: + + SslEndpoint(const IceSSL::PluginBaseIPtr&, const std::string&, ::Ice::Int, ::Ice::Int); + SslEndpoint(const IceSSL::PluginBaseIPtr&, const std::string&); + SslEndpoint(const IceSSL::PluginBaseIPtr&, IceInternal::BasicStream*); + + virtual void streamWrite(IceInternal::BasicStream*) const; + virtual std::string toString() const; + virtual ::Ice::Short type() const; + virtual ::Ice::Int timeout() const; + virtual IceInternal::EndpointPtr timeout(::Ice::Int) const; + virtual bool datagram() const; + virtual bool secure() const; + virtual bool unknown() const; + virtual IceInternal::TransceiverPtr clientTransceiver() const; + virtual IceInternal::TransceiverPtr serverTransceiver(IceInternal::EndpointPtr&) const; + virtual IceInternal::ConnectorPtr connector() const; + virtual IceInternal::AcceptorPtr acceptor(IceInternal::EndpointPtr&) const; + virtual bool equivalent(const IceInternal::TransceiverPtr&) const; + virtual bool equivalent(const IceInternal::AcceptorPtr&) const; + + virtual bool operator==(const IceInternal::Endpoint&) const; + virtual bool operator!=(const IceInternal::Endpoint&) const; + virtual bool operator<(const IceInternal::Endpoint&) const; + +private: + + // + // All members are const, because endpoints are immutable. + // + const IceSSL::PluginBaseIPtr _plugin; + const std::string _host; + const ::Ice::Int _port; + const ::Ice::Int _timeout; +}; + +class SslEndpointFactory : public IceInternal::EndpointFactory +{ +public: + + SslEndpointFactory(const IceSSL::PluginBaseIPtr&); + virtual ~SslEndpointFactory(); + + virtual ::Ice::Short type() const; + virtual const ::std::string& protocol() const; + virtual IceInternal::EndpointPtr create(const std::string&) const; + virtual IceInternal::EndpointPtr read(IceInternal::BasicStream*) const; + virtual void destroy(); + +private: + + IceSSL::PluginBaseIPtr _plugin; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/SslTransceiver.h b/cpp/src/IceSSL/SslTransceiver.h index 3f37406398a..fd07fcd78b6 100644 --- a/cpp/src/IceSSL/SslTransceiver.h +++ b/cpp/src/IceSSL/SslTransceiver.h @@ -1,56 +1,56 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_TRANSCEIVER_H
-#define ICE_SSL_TRANSCEIVER_H
-
-#include <Ice/LoggerF.h>
-#include <Ice/Transceiver.h>
-#include <IceSSL/SslConnectionF.h>
-#include <IceSSL/PluginBaseIF.h>
-#include <IceSSL/TraceLevelsF.h>
-
-namespace IceSSL
-{
-
-class SslConnector;
-class SslAcceptor;
-
-class SslTransceiver : public IceInternal::Transceiver
-{
-public:
-
- virtual SOCKET fd();
- virtual void close();
- virtual void shutdown();
- virtual void write(IceInternal::Buffer&, int);
- virtual void read(IceInternal::Buffer&, int);
- virtual std::string toString() const;
-
-private:
-
- SslTransceiver(const PluginBaseIPtr&, SOCKET, const ::IceSSL::ConnectionPtr&);
-
- virtual ~SslTransceiver();
- friend class SslConnector;
- friend class SslAcceptor;
-
- TraceLevelsPtr _traceLevels;
- Ice::LoggerPtr _logger;
- SOCKET _fd;
- fd_set _rFdSet;
- fd_set _wFdSet;
-
- ::IceSSL::ConnectionPtr _sslConnection;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_TRANSCEIVER_H +#define ICE_SSL_TRANSCEIVER_H + +#include <Ice/LoggerF.h> +#include <Ice/Transceiver.h> +#include <IceSSL/SslConnectionF.h> +#include <IceSSL/PluginBaseIF.h> +#include <IceSSL/TraceLevelsF.h> + +namespace IceSSL +{ + +class SslConnector; +class SslAcceptor; + +class SslTransceiver : public IceInternal::Transceiver +{ +public: + + virtual SOCKET fd(); + virtual void close(); + virtual void shutdown(); + virtual void write(IceInternal::Buffer&, int); + virtual void read(IceInternal::Buffer&, int); + virtual std::string toString() const; + +private: + + SslTransceiver(const PluginBaseIPtr&, SOCKET, const ::IceSSL::ConnectionPtr&); + + virtual ~SslTransceiver(); + friend class SslConnector; + friend class SslAcceptor; + + TraceLevelsPtr _traceLevels; + Ice::LoggerPtr _logger; + SOCKET _fd; + fd_set _rFdSet; + fd_set _wFdSet; + + ::IceSSL::ConnectionPtr _sslConnection; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/TempCerts.h b/cpp/src/IceSSL/TempCerts.h index 1614668cff2..57cfad5e07b 100644 --- a/cpp/src/IceSSL/TempCerts.h +++ b/cpp/src/IceSSL/TempCerts.h @@ -1,68 +1,68 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_TEMP_CERTS_H
-#define ICE_SSL_TEMP_CERTS_H
-
-#include <IceSSL/CertificateDesc.h>
-
-namespace IceSSL
-{
-
-class TempCertificates
-{
-public:
-
- TempCertificates();
- ~TempCertificates();
-
- void addRSACert(CertificateDesc&);
- void addDHParams(DiffieHellmanParamsFile&);
-
- RSAVector& getRSACerts();
- DHVector& getDHParams();
-
-protected:
-
- RSAVector _rsaCerts;
- DHVector _dhParams;
-};
-
-template<class Stream>
-inline Stream& operator << (Stream& target, TempCertificates& tmpCerts)
-{
- RSAVector::iterator iRSA = tmpCerts.getRSACerts().begin();
- RSAVector::iterator eRSA = tmpCerts.getRSACerts().end();
-
- while(iRSA != eRSA)
- {
- target << "RSA" << std::endl << "{" << std::endl;
- target << *iRSA;
- target << "}" << std::endl << std::endl;
- iRSA++;
- }
-
- DHVector::iterator iDHP = tmpCerts.getDHParams().begin();
- DHVector::iterator eDHP = tmpCerts.getDHParams().end();
-
- while(iDHP != eDHP)
- {
- target << "DH" << std::endl << "{" << std::endl;
- target << *iDHP;
- target << "}" << std::endl << std::endl;
- iDHP++;
- }
-
- return target;
-}
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_TEMP_CERTS_H +#define ICE_SSL_TEMP_CERTS_H + +#include <IceSSL/CertificateDesc.h> + +namespace IceSSL +{ + +class TempCertificates +{ +public: + + TempCertificates(); + ~TempCertificates(); + + void addRSACert(CertificateDesc&); + void addDHParams(DiffieHellmanParamsFile&); + + RSAVector& getRSACerts(); + DHVector& getDHParams(); + +protected: + + RSAVector _rsaCerts; + DHVector _dhParams; +}; + +template<class Stream> +inline Stream& operator << (Stream& target, TempCertificates& tmpCerts) +{ + RSAVector::iterator iRSA = tmpCerts.getRSACerts().begin(); + RSAVector::iterator eRSA = tmpCerts.getRSACerts().end(); + + while(iRSA != eRSA) + { + target << "RSA" << std::endl << "{" << std::endl; + target << *iRSA; + target << "}" << std::endl << std::endl; + iRSA++; + } + + DHVector::iterator iDHP = tmpCerts.getDHParams().begin(); + DHVector::iterator eDHP = tmpCerts.getDHParams().end(); + + while(iDHP != eDHP) + { + target << "DH" << std::endl << "{" << std::endl; + target << *iDHP; + target << "}" << std::endl << std::endl; + iDHP++; + } + + return target; +} + +} + +#endif diff --git a/cpp/src/IceSSL/TraceLevels.h b/cpp/src/IceSSL/TraceLevels.h index 519b8f0375b..d2ef318e0fc 100644 --- a/cpp/src/IceSSL/TraceLevels.h +++ b/cpp/src/IceSSL/TraceLevels.h @@ -1,37 +1,37 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_TRACE_LEVELS_H
-#define ICE_SSL_TRACE_LEVELS_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/ProtocolPluginFacadeF.h>
-#include <IceSSL/TraceLevelsF.h>
-
-namespace IceSSL
-{
-
-class TraceLevels : public ::IceUtil::Shared
-{
-public:
-
- TraceLevels(const IceInternal::ProtocolPluginFacadePtr&);
- virtual ~TraceLevels();
-
- const int network;
- const char* networkCat;
-
- const int security;
- const char* securityCat;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_TRACE_LEVELS_H +#define ICE_SSL_TRACE_LEVELS_H + +#include <IceUtil/Shared.h> +#include <Ice/ProtocolPluginFacadeF.h> +#include <IceSSL/TraceLevelsF.h> + +namespace IceSSL +{ + +class TraceLevels : public ::IceUtil::Shared +{ +public: + + TraceLevels(const IceInternal::ProtocolPluginFacadePtr&); + virtual ~TraceLevels(); + + const int network; + const char* networkCat; + + const int security; + const char* securityCat; +}; + +} + +#endif diff --git a/cpp/src/IceSSL/TraceLevelsF.h b/cpp/src/IceSSL/TraceLevelsF.h index ee35dd5c692..417c3bb7630 100644 --- a/cpp/src/IceSSL/TraceLevelsF.h +++ b/cpp/src/IceSSL/TraceLevelsF.h @@ -1,32 +1,32 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_SSL_TRACE_LEVELS_F_H
-#define ICE_SSL_TRACE_LEVELS_F_H
-
-#include <Ice/Handle.h>
-
-namespace IceSSL
-{
-
-class TraceLevels;
-typedef IceInternal::Handle<TraceLevels> TraceLevelsPtr;
-
-}
-
-namespace IceInternal
-{
-
-void incRef(IceSSL::TraceLevels*);
-void decRef(IceSSL::TraceLevels*);
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_SSL_TRACE_LEVELS_F_H +#define ICE_SSL_TRACE_LEVELS_F_H + +#include <Ice/Handle.h> + +namespace IceSSL +{ + +class TraceLevels; +typedef IceInternal::Handle<TraceLevels> TraceLevelsPtr; + +} + +namespace IceInternal +{ + +void incRef(IceSSL::TraceLevels*); +void decRef(IceSSL::TraceLevels*); + +} + +#endif diff --git a/cpp/src/IceStorm/Flushable.h b/cpp/src/IceStorm/Flushable.h index f071a72beb6..ee6566e337d 100644 --- a/cpp/src/IceStorm/Flushable.h +++ b/cpp/src/IceStorm/Flushable.h @@ -1,50 +1,50 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FLUSHABLE_H
-#define FLUSHABLE_H
-
-#include <IceUtil/Handle.h>
-#include <IceUtil/Shared.h>
-
-namespace IceStorm
-{
-
-//
-// Flushable interface.
-//
-class Flushable : public virtual IceUtil::Shared
-{
-public:
-
- Flushable() { }
- ~Flushable() { }
-
- //
- // Flush any pending writes.
- //
- virtual void flush() = 0;
-
- //
- // Is this flushable object invalid?
- //
- virtual bool inactive() const = 0;
-
- //
- // Equality for flushable objects.
- //
- virtual bool operator==(const Flushable&) const = 0;
-};
-
-typedef IceUtil::Handle<Flushable> FlushablePtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FLUSHABLE_H +#define FLUSHABLE_H + +#include <IceUtil/Handle.h> +#include <IceUtil/Shared.h> + +namespace IceStorm +{ + +// +// Flushable interface. +// +class Flushable : public virtual IceUtil::Shared +{ +public: + + Flushable() { } + ~Flushable() { } + + // + // Flush any pending writes. + // + virtual void flush() = 0; + + // + // Is this flushable object invalid? + // + virtual bool inactive() const = 0; + + // + // Equality for flushable objects. + // + virtual bool operator==(const Flushable&) const = 0; +}; + +typedef IceUtil::Handle<Flushable> FlushablePtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/Flusher.h b/cpp/src/IceStorm/Flusher.h index dd1849ee7be..ab0828ee146 100644 --- a/cpp/src/IceStorm/Flusher.h +++ b/cpp/src/IceStorm/Flusher.h @@ -1,56 +1,56 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef FLUSHER_H
-#define FLUSHER_H
-
-#include <IceUtil/Handle.h>
-#include <IceUtil/Shared.h>
-#include <Ice/CommunicatorF.h>
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class FlusherThread;
-typedef IceUtil::Handle<FlusherThread> FlusherThreadPtr;
-
-class TraceLevels;
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-class Flushable;
-typedef IceUtil::Handle<Flushable> FlushablePtr;
-
-//
-// Responsible for flushing Flushable objects at regular intervals.
-//
-class Flusher : public IceUtil::Shared
-{
-public:
-
- Flusher(const Ice::CommunicatorPtr&, const TraceLevelsPtr&);
- ~Flusher();
-
- void add(const FlushablePtr&);
- void remove(const FlushablePtr&);
- void stopFlushing();
-
-private:
-
- FlusherThreadPtr _thread;
-};
-
-typedef IceUtil::Handle<Flusher> FlusherPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef FLUSHER_H +#define FLUSHER_H + +#include <IceUtil/Handle.h> +#include <IceUtil/Shared.h> +#include <Ice/CommunicatorF.h> + +namespace IceStorm +{ + +// +// Forward declarations. +// +class FlusherThread; +typedef IceUtil::Handle<FlusherThread> FlusherThreadPtr; + +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +class Flushable; +typedef IceUtil::Handle<Flushable> FlushablePtr; + +// +// Responsible for flushing Flushable objects at regular intervals. +// +class Flusher : public IceUtil::Shared +{ +public: + + Flusher(const Ice::CommunicatorPtr&, const TraceLevelsPtr&); + ~Flusher(); + + void add(const FlushablePtr&); + void remove(const FlushablePtr&); + void stopFlushing(); + +private: + + FlusherThreadPtr _thread; +}; + +typedef IceUtil::Handle<Flusher> FlusherPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/LinkSubscriber.h b/cpp/src/IceStorm/LinkSubscriber.h index 45f447d1e8f..5b437892f49 100644 --- a/cpp/src/IceStorm/LinkSubscriber.h +++ b/cpp/src/IceStorm/LinkSubscriber.h @@ -1,47 +1,47 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef LINK_SUBSCRIBER_H
-#define LINK_SUBSCRIBER_H
-
-#include <IceStorm/Flushable.h>
-#include <IceStorm/Subscriber.h>
-#include <IceStorm/IceStormInternal.h> // For TopicLink
-
-namespace IceStorm
-{
-
-class LinkSubscriber : public Subscriber, public Flushable
-{
-public:
-
- LinkSubscriber(const TraceLevelsPtr&, const TopicLinkPrx&, Ice::Int);
- ~LinkSubscriber();
-
- virtual bool persistent() const;
- virtual bool inactive() const;
- virtual void unsubscribe();
- virtual void replace();
- virtual void publish(const Event&);
-
- virtual void flush();
- virtual bool operator==(const Flushable&) const;
-
-private:
-
- // Immutable
- TopicLinkPrx _obj;
- Ice::Int _cost;
-};
-
-} // End namespace IceStorm
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef LINK_SUBSCRIBER_H +#define LINK_SUBSCRIBER_H + +#include <IceStorm/Flushable.h> +#include <IceStorm/Subscriber.h> +#include <IceStorm/IceStormInternal.h> // For TopicLink + +namespace IceStorm +{ + +class LinkSubscriber : public Subscriber, public Flushable +{ +public: + + LinkSubscriber(const TraceLevelsPtr&, const TopicLinkPrx&, Ice::Int); + ~LinkSubscriber(); + + virtual bool persistent() const; + virtual bool inactive() const; + virtual void unsubscribe(); + virtual void replace(); + virtual void publish(const Event&); + + virtual void flush(); + virtual bool operator==(const Flushable&) const; + +private: + + // Immutable + TopicLinkPrx _obj; + Ice::Int _cost; +}; + +} // End namespace IceStorm + +#endif + diff --git a/cpp/src/IceStorm/OnewayBatchSubscriber.h b/cpp/src/IceStorm/OnewayBatchSubscriber.h index 3dda3b00889..4b90d33d1a6 100644 --- a/cpp/src/IceStorm/OnewayBatchSubscriber.h +++ b/cpp/src/IceStorm/OnewayBatchSubscriber.h @@ -1,50 +1,50 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ONEWAY_BATCH_SUBSCRIBER_H
-#define ONEWAY_BATCH_SUBSCRIBER_H
-
-#include <IceStorm/OnewaySubscriber.h>
-#include <IceStorm/Flushable.h>
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class Flusher;
-typedef IceUtil::Handle<Flusher> FlusherPtr;
-
-class OnewayBatchSubscriber : public OnewaySubscriber, public Flushable
-{
-public:
-
- OnewayBatchSubscriber(const TraceLevelsPtr&, const FlusherPtr&, const Ice::ObjectPrx&);
- ~OnewayBatchSubscriber();
-
- virtual void unsubscribe();
- virtual void replace();
- virtual bool inactive() const;
-
- virtual void flush();
-
- virtual bool operator==(const Flushable&) const;
-
-private:
-
- FlusherPtr _flusher;
-};
-
-typedef IceUtil::Handle<OnewayBatchSubscriber> OnewayBatchSubscriberPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ONEWAY_BATCH_SUBSCRIBER_H +#define ONEWAY_BATCH_SUBSCRIBER_H + +#include <IceStorm/OnewaySubscriber.h> +#include <IceStorm/Flushable.h> + +namespace IceStorm +{ + +// +// Forward declarations. +// +class Flusher; +typedef IceUtil::Handle<Flusher> FlusherPtr; + +class OnewayBatchSubscriber : public OnewaySubscriber, public Flushable +{ +public: + + OnewayBatchSubscriber(const TraceLevelsPtr&, const FlusherPtr&, const Ice::ObjectPrx&); + ~OnewayBatchSubscriber(); + + virtual void unsubscribe(); + virtual void replace(); + virtual bool inactive() const; + + virtual void flush(); + + virtual bool operator==(const Flushable&) const; + +private: + + FlusherPtr _flusher; +}; + +typedef IceUtil::Handle<OnewayBatchSubscriber> OnewayBatchSubscriberPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/OnewaySubscriber.h b/cpp/src/IceStorm/OnewaySubscriber.h index cef8f63993a..032821f271a 100644 --- a/cpp/src/IceStorm/OnewaySubscriber.h +++ b/cpp/src/IceStorm/OnewaySubscriber.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ONEWAY_SUBSCRIBER_H
-#define ONEWAY_SUBSCRIBER_H
-
-#include <IceStorm/Subscriber.h>
-
-namespace IceStorm
-{
-
-class OnewaySubscriber : public Subscriber
-{
-public:
-
- OnewaySubscriber(const TraceLevelsPtr&, const Ice::ObjectPrx&);
- ~OnewaySubscriber();
-
- virtual bool persistent() const;
- virtual void unsubscribe();
- virtual void replace();
- virtual void publish(const Event&);
-
-protected:
-
- // Immutable
- Ice::ObjectPrx _obj;
-};
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ONEWAY_SUBSCRIBER_H +#define ONEWAY_SUBSCRIBER_H + +#include <IceStorm/Subscriber.h> + +namespace IceStorm +{ + +class OnewaySubscriber : public Subscriber +{ +public: + + OnewaySubscriber(const TraceLevelsPtr&, const Ice::ObjectPrx&); + ~OnewaySubscriber(); + + virtual bool persistent() const; + virtual void unsubscribe(); + virtual void replace(); + virtual void publish(const Event&); + +protected: + + // Immutable + Ice::ObjectPrx _obj; +}; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/Parser.h b/cpp/src/IceStorm/Parser.h index 841f8e22d1f..a60d2866f58 100644 --- a/cpp/src/IceStorm/Parser.h +++ b/cpp/src/IceStorm/Parser.h @@ -1,108 +1,108 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_STORM_PARSER_H
-#define ICE_STORM_PARSER_H
-
-#include <IceUtil/Handle.h>
-#include <IceStorm/IceStorm.h>
-#include <list>
-
-#ifdef _WIN32
-# include <io.h>
-# define isatty _isatty
-# define fileno _fileno
-// '_isatty' : inconsistent dll linkage. dllexport assumed.
-# pragma warning( disable : 4273 )
-#endif
-
-//
-// Stuff for flex and bison
-//
-
-#define YYSTYPE std::list<std::string>
-#define YY_DECL int yylex(YYSTYPE* yylvalp)
-YY_DECL;
-int yyparse();
-
-//
-// I must set the initial stack depth to the maximum stack depth to
-// disable bison stack resizing. The bison stack resizing routines use
-// simple malloc/alloc/memcpy calls, which do not work for the
-// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
-// assignment operator, etc.
-//
-#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
-#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
-
-//
-// Newer bison versions allow to disable stack resizing by defining
-// yyoverflow.
-//
-#define yyoverflow(a, b, c, d, e, f) yyerror(a)
-
-namespace IceStorm
-{
-
-//
-// Forward declaration.
-//
-class Parser;
-typedef ::IceUtil::Handle<Parser> ParserPtr;
-
-class Parser : public ::IceUtil::SimpleShared
-{
-public:
-
- static ParserPtr createParser(const Ice::CommunicatorPtr&, const IceStorm::TopicManagerPrx&);
-
- void usage();
-
- void create(const std::list<std::string>&);
- void destroy(const std::list<std::string>&);
- void dolist(const std::list<std::string>&); // Don't name list - conflicts with std::list
- void link(const std::list<std::string>&);
- void unlink(const std::list<std::string>&);
- void graph(const std::list<std::string>&);
- void shutdown();
-
- void getInput(char*, int&, int);
- void nextLine();
- void continueLine();
- char* getPrompt();
- void scanPosition(const char*);
-
- void error(const char*);
- void error(const std::string&);
-
- void warning(const char*);
- void warning(const std::string&);
-
- int parse(FILE*, bool);
- int parse(const std::string&, bool);
-
-private:
-
- Parser(const Ice::CommunicatorPtr&, const IceStorm::TopicManagerPrx&);
-
- std::string _commands;
- Ice::CommunicatorPtr _communicator;
- IceStorm::TopicManagerPrx _admin;
- bool _continue;
- int _errors;
- int _currentLine;
- std::string _currentFile;
-};
-
-extern Parser* parser; // The current parser for bison/flex
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_STORM_PARSER_H +#define ICE_STORM_PARSER_H + +#include <IceUtil/Handle.h> +#include <IceStorm/IceStorm.h> +#include <list> + +#ifdef _WIN32 +# include <io.h> +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. +# pragma warning( disable : 4273 ) +#endif + +// +// Stuff for flex and bison +// + +#define YYSTYPE std::list<std::string> +#define YY_DECL int yylex(YYSTYPE* yylvalp) +YY_DECL; +int yyparse(); + +// +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +// +#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum. +#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. + +// +// Newer bison versions allow to disable stack resizing by defining +// yyoverflow. +// +#define yyoverflow(a, b, c, d, e, f) yyerror(a) + +namespace IceStorm +{ + +// +// Forward declaration. +// +class Parser; +typedef ::IceUtil::Handle<Parser> ParserPtr; + +class Parser : public ::IceUtil::SimpleShared +{ +public: + + static ParserPtr createParser(const Ice::CommunicatorPtr&, const IceStorm::TopicManagerPrx&); + + void usage(); + + void create(const std::list<std::string>&); + void destroy(const std::list<std::string>&); + void dolist(const std::list<std::string>&); // Don't name list - conflicts with std::list + void link(const std::list<std::string>&); + void unlink(const std::list<std::string>&); + void graph(const std::list<std::string>&); + void shutdown(); + + void getInput(char*, int&, int); + void nextLine(); + void continueLine(); + char* getPrompt(); + void scanPosition(const char*); + + void error(const char*); + void error(const std::string&); + + void warning(const char*); + void warning(const std::string&); + + int parse(FILE*, bool); + int parse(const std::string&, bool); + +private: + + Parser(const Ice::CommunicatorPtr&, const IceStorm::TopicManagerPrx&); + + std::string _commands; + Ice::CommunicatorPtr _communicator; + IceStorm::TopicManagerPrx _admin; + bool _continue; + int _errors; + int _currentLine; + std::string _currentFile; +}; + +extern Parser* parser; // The current parser for bison/flex + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/Subscriber.h b/cpp/src/IceStorm/Subscriber.h index 5f30a365b89..453c8b125b3 100644 --- a/cpp/src/IceStorm/Subscriber.h +++ b/cpp/src/IceStorm/Subscriber.h @@ -1,136 +1,136 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SUBSCRIBER_H
-#define SUBSCRIBER_H
-
-#include <IceUtil/Mutex.h>
-#include <Ice/Current.h> // For Ice::Context
-#include <Ice/Identity.h>
-
-#include <vector>
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class TraceLevels;
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-//
-// Note that at present this requires to copy the event which isn't
-// nice. If this indeed becomes a bottleneck then either the event can
-// carry a reference to the blob, context & op (while event itself
-// isn't copied), or the op, blob & context can be passed along as
-// arguments (or do copy on write, or some such trick).
-//
-struct Event
-{
- bool forwarded;
- int cost;
- std::string op;
- bool nonmutating;
- std::vector< Ice::Byte> data;
- Ice::Context context;
-};
-
-//
-// Subscriber interface.
-//
-class Subscriber : public virtual IceUtil::Shared
-{
-public:
-
- Subscriber(const TraceLevelsPtr& traceLevels, const Ice::Identity&);
- ~Subscriber();
-
- virtual bool persistent() const = 0;
-
- //
- // Return true if the Subscriber is not active, false otherwise.
- //
- bool inactive() const;
-
- //
- // Retrieve true if the Subscriber is in the error state, false
- // otherwise.
- //
- bool error() const;
-
- //
- // Retrieve the identity of the Subscriber.
- //
- Ice::Identity id() const;
-
- //
- // Unsubscribe. Mark the state as Unsubscribed.
- //
- virtual void unsubscribe() = 0;
-
- //
- // Unsubscribe. Mark the state as Replaced.
- //
- virtual void replace() = 0;
-
- //
- // Publish the given event. Mark the state as Error in the event of
- // a problem.
- //
- virtual void publish(const Event&) = 0;
-
-protected:
-
- // Immutable
- TraceLevelsPtr _traceLevels;
-
- //
- // Subscriber state.
- //
- enum State
- {
- //
- // The Subscriber is active.
- //
- StateActive,
- //
- // The Subscriber encountered an error during event
- // transmission.
- //
- StateError,
- //
- // The Subscriber has been unsubscribed.
- //
- StateUnsubscribed,
- //
- // The Subscriber has been replaced.
- //
- StateReplaced
- };
-
- IceUtil::Mutex _stateMutex;
- State _state;
-
-private:
-
- //
- // This id is the full id of the subscriber for a particular topic.
- //
- // Immutable.
- //
- Ice::Identity _id;
-};
-
-typedef IceUtil::Handle<Subscriber> SubscriberPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SUBSCRIBER_H +#define SUBSCRIBER_H + +#include <IceUtil/Mutex.h> +#include <Ice/Current.h> // For Ice::Context +#include <Ice/Identity.h> + +#include <vector> + +namespace IceStorm +{ + +// +// Forward declarations. +// +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +// +// Note that at present this requires to copy the event which isn't +// nice. If this indeed becomes a bottleneck then either the event can +// carry a reference to the blob, context & op (while event itself +// isn't copied), or the op, blob & context can be passed along as +// arguments (or do copy on write, or some such trick). +// +struct Event +{ + bool forwarded; + int cost; + std::string op; + bool nonmutating; + std::vector< Ice::Byte> data; + Ice::Context context; +}; + +// +// Subscriber interface. +// +class Subscriber : public virtual IceUtil::Shared +{ +public: + + Subscriber(const TraceLevelsPtr& traceLevels, const Ice::Identity&); + ~Subscriber(); + + virtual bool persistent() const = 0; + + // + // Return true if the Subscriber is not active, false otherwise. + // + bool inactive() const; + + // + // Retrieve true if the Subscriber is in the error state, false + // otherwise. + // + bool error() const; + + // + // Retrieve the identity of the Subscriber. + // + Ice::Identity id() const; + + // + // Unsubscribe. Mark the state as Unsubscribed. + // + virtual void unsubscribe() = 0; + + // + // Unsubscribe. Mark the state as Replaced. + // + virtual void replace() = 0; + + // + // Publish the given event. Mark the state as Error in the event of + // a problem. + // + virtual void publish(const Event&) = 0; + +protected: + + // Immutable + TraceLevelsPtr _traceLevels; + + // + // Subscriber state. + // + enum State + { + // + // The Subscriber is active. + // + StateActive, + // + // The Subscriber encountered an error during event + // transmission. + // + StateError, + // + // The Subscriber has been unsubscribed. + // + StateUnsubscribed, + // + // The Subscriber has been replaced. + // + StateReplaced + }; + + IceUtil::Mutex _stateMutex; + State _state; + +private: + + // + // This id is the full id of the subscriber for a particular topic. + // + // Immutable. + // + Ice::Identity _id; +}; + +typedef IceUtil::Handle<Subscriber> SubscriberPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/SubscriberFactory.h b/cpp/src/IceStorm/SubscriberFactory.h index 904f8d35b5f..9e6ee95e2af 100644 --- a/cpp/src/IceStorm/SubscriberFactory.h +++ b/cpp/src/IceStorm/SubscriberFactory.h @@ -1,62 +1,62 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SUBSCRIBER_FACTORY_H
-#define SUBSCRIBER_FACTORY_H
-
-#include <IceStorm/IceStormInternal.h> // For QoS, TopicLink
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class TraceLevels;
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-class Subscriber;
-typedef IceUtil::Handle<Subscriber> SubscriberPtr;
-
-class Flusher;
-typedef IceUtil::Handle<Flusher> FlusherPtr;
-
-//
-// Factory object that knows how to create various type of Subscriber
-// objects.
-//
-class SubscriberFactory : public IceUtil::Shared
-{
-public:
-
- SubscriberFactory(const TraceLevelsPtr&, const FlusherPtr&);
-
- //
- // Create a link subscriber (that is a subscriber that points to
- // another topic instance).
- //
- SubscriberPtr createLinkSubscriber(const TopicLinkPrx&, Ice::Int);
-
- //
- // Create a Subscriber with the given QoS.
- //
- SubscriberPtr createSubscriber(const QoS&, const Ice::ObjectPrx&);
-
-private:
-
- TraceLevelsPtr _traceLevels;
- FlusherPtr _flusher;
-};
-
-typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SUBSCRIBER_FACTORY_H +#define SUBSCRIBER_FACTORY_H + +#include <IceStorm/IceStormInternal.h> // For QoS, TopicLink + +namespace IceStorm +{ + +// +// Forward declarations. +// +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +class Subscriber; +typedef IceUtil::Handle<Subscriber> SubscriberPtr; + +class Flusher; +typedef IceUtil::Handle<Flusher> FlusherPtr; + +// +// Factory object that knows how to create various type of Subscriber +// objects. +// +class SubscriberFactory : public IceUtil::Shared +{ +public: + + SubscriberFactory(const TraceLevelsPtr&, const FlusherPtr&); + + // + // Create a link subscriber (that is a subscriber that points to + // another topic instance). + // + SubscriberPtr createLinkSubscriber(const TopicLinkPrx&, Ice::Int); + + // + // Create a Subscriber with the given QoS. + // + SubscriberPtr createSubscriber(const QoS&, const Ice::ObjectPrx&); + +private: + + TraceLevelsPtr _traceLevels; + FlusherPtr _flusher; +}; + +typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/TopicI.h b/cpp/src/IceStorm/TopicI.h index f3f1a79ffcf..67153cfda6c 100644 --- a/cpp/src/IceStorm/TopicI.h +++ b/cpp/src/IceStorm/TopicI.h @@ -1,92 +1,92 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TOPIC_I_H
-#define TOPIC_I_H
-
-#include <IceUtil/RecMutex.h>
-#include <IceStorm/IceStormInternal.h>
-#include <IceStorm/IdentityLinkDict.h>
-#include <IceStorm/SubscriberFactory.h>
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class TopicSubscribers;
-typedef IceUtil::Handle<TopicSubscribers> TopicSubscribersPtr;
-
-class TraceLevels;
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-class SubscriberFactory;
-typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr;
-
-//
-// TopicInternal implementation.
-//
-class TopicI : public TopicInternal, public IceUtil::RecMutex
-{
-public:
-
- TopicI(const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, const std::string&, const SubscriberFactoryPtr&,
- const Freeze::DBPtr&);
- ~TopicI();
-
- virtual std::string getName(const Ice::Current&);
- virtual Ice::ObjectPrx getPublisher(const Ice::Current&);
- virtual void destroy(const Ice::Current&);
- virtual void link(const TopicPrx&, Ice::Int, const Ice::Current&);
- virtual void unlink(const TopicPrx&, const Ice::Current&);
- virtual LinkInfoSeq getLinkInfoSeq(const Ice::Current&);
-
- virtual TopicLinkPrx getLinkProxy(const Ice::Current&);
-
- // Internal methods
- bool destroyed() const;
- void subscribe(const Ice::ObjectPrx&, const QoS&);
- void unsubscribe(const Ice::ObjectPrx&);
-
- void reap();
-
-private:
-
- //
- // Immutable members.
- //
- Ice::ObjectAdapterPtr _adapter;
- TraceLevelsPtr _traceLevels;
- std::string _name; // The topic name
- SubscriberFactoryPtr _factory;
-
- Ice::ObjectPtr _publisher; // Publisher & associated proxy
- Ice::ObjectPrx _publisherPrx;
-
- Ice::ObjectPtr _link; // TopicLink & associated proxy
- TopicLinkPrx _linkPrx;
-
- //
- // Mutable members. Protected by *this
- //
- bool _destroyed; // Has this Topic been destroyed?
-
- TopicSubscribersPtr _subscribers; // Set of Subscribers
-
- IdentityLinkDict _links; // The database of Topic links
- Freeze::DBPtr _linksDb;
-};
-
-typedef IceUtil::Handle<TopicI> TopicIPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TOPIC_I_H +#define TOPIC_I_H + +#include <IceUtil/RecMutex.h> +#include <IceStorm/IceStormInternal.h> +#include <IceStorm/IdentityLinkDict.h> +#include <IceStorm/SubscriberFactory.h> + +namespace IceStorm +{ + +// +// Forward declarations. +// +class TopicSubscribers; +typedef IceUtil::Handle<TopicSubscribers> TopicSubscribersPtr; + +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +class SubscriberFactory; +typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr; + +// +// TopicInternal implementation. +// +class TopicI : public TopicInternal, public IceUtil::RecMutex +{ +public: + + TopicI(const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, const std::string&, const SubscriberFactoryPtr&, + const Freeze::DBPtr&); + ~TopicI(); + + virtual std::string getName(const Ice::Current&); + virtual Ice::ObjectPrx getPublisher(const Ice::Current&); + virtual void destroy(const Ice::Current&); + virtual void link(const TopicPrx&, Ice::Int, const Ice::Current&); + virtual void unlink(const TopicPrx&, const Ice::Current&); + virtual LinkInfoSeq getLinkInfoSeq(const Ice::Current&); + + virtual TopicLinkPrx getLinkProxy(const Ice::Current&); + + // Internal methods + bool destroyed() const; + void subscribe(const Ice::ObjectPrx&, const QoS&); + void unsubscribe(const Ice::ObjectPrx&); + + void reap(); + +private: + + // + // Immutable members. + // + Ice::ObjectAdapterPtr _adapter; + TraceLevelsPtr _traceLevels; + std::string _name; // The topic name + SubscriberFactoryPtr _factory; + + Ice::ObjectPtr _publisher; // Publisher & associated proxy + Ice::ObjectPrx _publisherPrx; + + Ice::ObjectPtr _link; // TopicLink & associated proxy + TopicLinkPrx _linkPrx; + + // + // Mutable members. Protected by *this + // + bool _destroyed; // Has this Topic been destroyed? + + TopicSubscribersPtr _subscribers; // Set of Subscribers + + IdentityLinkDict _links; // The database of Topic links + Freeze::DBPtr _linksDb; +}; + +typedef IceUtil::Handle<TopicI> TopicIPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/TopicManagerI.h b/cpp/src/IceStorm/TopicManagerI.h index 993cf1a5d0a..0aa5b91f784 100644 --- a/cpp/src/IceStorm/TopicManagerI.h +++ b/cpp/src/IceStorm/TopicManagerI.h @@ -1,78 +1,78 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TOPIC_MANAGER_I_H
-#define TOPIC_MANAGER_I_H
-
-#include <IceStorm/IceStorm.h>
-#include <IceStorm/StringBoolDict.h>
-
-namespace IceStorm
-{
-
-//
-// Forward declarations.
-//
-class TopicI;
-typedef IceUtil::Handle<TopicI> TopicIPtr;
-
-class TraceLevels;
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-class Flusher;
-typedef IceUtil::Handle<Flusher> FlusherPtr;
-
-class SubscriberFactory;
-typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr;
-
-//
-// Map of TopicImplementation objects.
-//
-typedef std::map<std::string, TopicIPtr> TopicIMap;
-
-//
-// TopicManager implementation.
-//
-class TopicManagerI : public TopicManager, public IceUtil::Mutex
-{
-public:
-
- TopicManagerI(const Ice::CommunicatorPtr&, const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&,
- const Freeze::DBEnvironmentPtr&, const Freeze::DBPtr&);
- ~TopicManagerI();
-
- virtual TopicPrx create(const std::string&, const Ice::Current&);
- virtual TopicPrx retrieve(const std::string&, const Ice::Current&);
- virtual TopicDict retrieveAll(const Ice::Current&);
- virtual void subscribe(const QoS&, const Ice::ObjectPrx&, const Ice::Current&);
- virtual void unsubscribe(const Ice::ObjectPrx&, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
- void reap();
-
-private:
-
- void installTopic(const std::string&, const std::string&, bool);
-
- Ice::CommunicatorPtr _communicator;
- Ice::ObjectAdapterPtr _adapter;
- TraceLevelsPtr _traceLevels;
- TopicIMap _topicIMap;
- FlusherPtr _flusher;
- SubscriberFactoryPtr _factory;
- Freeze::DBEnvironmentPtr _dbEnv;
- StringBoolDict _topics;
-};
-
-typedef IceUtil::Handle<TopicManagerI> TopicManagerIPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TOPIC_MANAGER_I_H +#define TOPIC_MANAGER_I_H + +#include <IceStorm/IceStorm.h> +#include <IceStorm/StringBoolDict.h> + +namespace IceStorm +{ + +// +// Forward declarations. +// +class TopicI; +typedef IceUtil::Handle<TopicI> TopicIPtr; + +class TraceLevels; +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +class Flusher; +typedef IceUtil::Handle<Flusher> FlusherPtr; + +class SubscriberFactory; +typedef IceUtil::Handle<SubscriberFactory> SubscriberFactoryPtr; + +// +// Map of TopicImplementation objects. +// +typedef std::map<std::string, TopicIPtr> TopicIMap; + +// +// TopicManager implementation. +// +class TopicManagerI : public TopicManager, public IceUtil::Mutex +{ +public: + + TopicManagerI(const Ice::CommunicatorPtr&, const Ice::ObjectAdapterPtr&, const TraceLevelsPtr&, + const Freeze::DBEnvironmentPtr&, const Freeze::DBPtr&); + ~TopicManagerI(); + + virtual TopicPrx create(const std::string&, const Ice::Current&); + virtual TopicPrx retrieve(const std::string&, const Ice::Current&); + virtual TopicDict retrieveAll(const Ice::Current&); + virtual void subscribe(const QoS&, const Ice::ObjectPrx&, const Ice::Current&); + virtual void unsubscribe(const Ice::ObjectPrx&, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + + void reap(); + +private: + + void installTopic(const std::string&, const std::string&, bool); + + Ice::CommunicatorPtr _communicator; + Ice::ObjectAdapterPtr _adapter; + TraceLevelsPtr _traceLevels; + TopicIMap _topicIMap; + FlusherPtr _flusher; + SubscriberFactoryPtr _factory; + Freeze::DBEnvironmentPtr _dbEnv; + StringBoolDict _topics; +}; + +typedef IceUtil::Handle<TopicManagerI> TopicManagerIPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/TraceLevels.h b/cpp/src/IceStorm/TraceLevels.h index e971dd28169..fbc08dc4d6f 100644 --- a/cpp/src/IceStorm/TraceLevels.h +++ b/cpp/src/IceStorm/TraceLevels.h @@ -1,47 +1,47 @@ -// **********************************************************************
-//
-// Copyright (c) 2002
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef ICE_STORM_TRACE_LEVELS_H
-#define ICE_STORM_TRACE_LEVELS_H
-
-#include <IceUtil/Shared.h>
-#include <Ice/PropertiesF.h>
-#include <Ice/LoggerF.h>
-
-namespace IceStorm
-{
-
-class TraceLevels : public ::IceUtil::Shared
-{
-public:
-
- TraceLevels(const ::Ice::PropertiesPtr&, const Ice::LoggerPtr&);
- virtual ~TraceLevels();
-
- const int topicMgr;
- const char* topicMgrCat;
-
- const int topic;
- const char* topicCat;
-
- const int flush;
- const char* flushCat;
-
- const int subscriber;
- const char* subscriberCat;
-
- const Ice::LoggerPtr logger;
-};
-
-typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr;
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_STORM_TRACE_LEVELS_H +#define ICE_STORM_TRACE_LEVELS_H + +#include <IceUtil/Shared.h> +#include <Ice/PropertiesF.h> +#include <Ice/LoggerF.h> + +namespace IceStorm +{ + +class TraceLevels : public ::IceUtil::Shared +{ +public: + + TraceLevels(const ::Ice::PropertiesPtr&, const Ice::LoggerPtr&); + virtual ~TraceLevels(); + + const int topicMgr; + const char* topicMgrCat; + + const int topic; + const char* topicCat; + + const int flush; + const char* flushCat; + + const int subscriber; + const char* subscriberCat; + + const Ice::LoggerPtr logger; +}; + +typedef IceUtil::Handle<TraceLevels> TraceLevelsPtr; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/WeightedGraph.h b/cpp/src/IceStorm/WeightedGraph.h index c0465ebd7f3..edbaa55a265 100644 --- a/cpp/src/IceStorm/WeightedGraph.h +++ b/cpp/src/IceStorm/WeightedGraph.h @@ -1,116 +1,116 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef WEIGHTED_GRAPH_H
-#define WEIGHTED_GRAPH_H
-
-#include <IceUtil/Config.h>
-#include <vector>
-#include <list>
-#include <map>
-
-namespace IceStorm
-{
-
-//
-// Forward declaration.
-//
-class SAXGraphHandler;
-
-//
-// A weighted graph. This class uses internally a vertex, adjacency
-// matrix representation. Each vertex has a name. The [i,j] of the
-// adjacency graph represents the the edge from _vertices[i] to
-// _vertices[j].
-//
-class WeightedGraph
-{
-public:
-
- WeightedGraph(bool = false);
- ~WeightedGraph();
-
- //
- // Parse the graph from the given XML file. Returns false in event
- // of a parse error.
- //
- bool parse(const std::string&);
-
- //
- // Compute a new adjacency matrix with the given cost.
- //
- void compute(std::vector<int>&, int);
-
- //
- // Render the edge table in ASCII format.
- //
- void dump(std::ostream&);
-
- //
- // Swap the adjacency matrix. This could be actual swap.
- //
- void swap(const std::vector<int>&);
-
- //
- // Get all the vertices.
- //
- std::vector<std::string> getVertices() const;
-
- //
- // Get the set of edges for a vertex. The return data is the name
- // of the second vertex, and the cost.
- //
- std::vector<std::pair<std::string, int> > getEdgesFor(const std::string&) const;
-
-private:
-
- //
- // Recursive function used in computation of new edge set.
- //
- void visit(unsigned int, int, std::list<std::pair<unsigned int, int> >&, int);
-
- //
- // Callbacks from parsing routines
- //
- void addVertex(const std::string&);
- void addEdge(const std::string&, const std::string&, int);
-
- void error();
-
- //
- // List of vertices.
- //
- std::vector<std::string> _vertices;
-
- //
- // Lookup table - maps from vertex name to vertex index.
- //
- std::map<std::string, int> _vlookup;
-
- //
- // The adjacency matrix. -1 indicates no edge, otherwise the value
- // is the cost.
- //
- std::vector<int> _edges;
-
- //
- // Is the graph reflective? That is if there is edge (v1, v2,
- // cost) then there is (v2, v1, cost).
- //
- bool _reflective;
-
- int _error;
-
- friend class SAXGraphHandler;
-};
-
-} // End namespace IceStorm
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef WEIGHTED_GRAPH_H +#define WEIGHTED_GRAPH_H + +#include <IceUtil/Config.h> +#include <vector> +#include <list> +#include <map> + +namespace IceStorm +{ + +// +// Forward declaration. +// +class SAXGraphHandler; + +// +// A weighted graph. This class uses internally a vertex, adjacency +// matrix representation. Each vertex has a name. The [i,j] of the +// adjacency graph represents the the edge from _vertices[i] to +// _vertices[j]. +// +class WeightedGraph +{ +public: + + WeightedGraph(bool = false); + ~WeightedGraph(); + + // + // Parse the graph from the given XML file. Returns false in event + // of a parse error. + // + bool parse(const std::string&); + + // + // Compute a new adjacency matrix with the given cost. + // + void compute(std::vector<int>&, int); + + // + // Render the edge table in ASCII format. + // + void dump(std::ostream&); + + // + // Swap the adjacency matrix. This could be actual swap. + // + void swap(const std::vector<int>&); + + // + // Get all the vertices. + // + std::vector<std::string> getVertices() const; + + // + // Get the set of edges for a vertex. The return data is the name + // of the second vertex, and the cost. + // + std::vector<std::pair<std::string, int> > getEdgesFor(const std::string&) const; + +private: + + // + // Recursive function used in computation of new edge set. + // + void visit(unsigned int, int, std::list<std::pair<unsigned int, int> >&, int); + + // + // Callbacks from parsing routines + // + void addVertex(const std::string&); + void addEdge(const std::string&, const std::string&, int); + + void error(); + + // + // List of vertices. + // + std::vector<std::string> _vertices; + + // + // Lookup table - maps from vertex name to vertex index. + // + std::map<std::string, int> _vlookup; + + // + // The adjacency matrix. -1 indicates no edge, otherwise the value + // is the cost. + // + std::vector<int> _edges; + + // + // Is the graph reflective? That is if there is edge (v1, v2, + // cost) then there is (v2, v1, cost). + // + bool _reflective; + + int _error; + + friend class SAXGraphHandler; +}; + +} // End namespace IceStorm + +#endif diff --git a/cpp/src/IceStorm/dummyinclude/unistd.h b/cpp/src/IceStorm/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/src/IceStorm/dummyinclude/unistd.h +++ b/cpp/src/IceStorm/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/src/Slice/GrammarUtil.h b/cpp/src/Slice/GrammarUtil.h index 6c59d265b8a..d26447b9fe6 100644 --- a/cpp/src/Slice/GrammarUtil.h +++ b/cpp/src/Slice/GrammarUtil.h @@ -1,135 +1,135 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef SLICE_GRAMMER_UTIL_H
-#define SLICE_GRAMMER_UTIL_H
-
-#include <Slice/Parser.h>
-
-namespace Slice
-{
-
-class StringTok;
-class StringListTok;
-class TypeStringTok;
-class TypeStringListTok;
-class BoolTok;
-class ExceptionListTok;
-class ClassListTok;
-class EnumeratorListTok;
-
-typedef ::IceUtil::Handle<StringTok> StringTokPtr;
-typedef ::IceUtil::Handle<StringListTok> StringListTokPtr;
-typedef ::IceUtil::Handle<TypeStringTok> TypeStringTokPtr;
-typedef ::IceUtil::Handle<TypeStringListTok> TypeStringListTokPtr;
-typedef ::IceUtil::Handle<BoolTok> BoolTokPtr;
-typedef ::IceUtil::Handle<ExceptionListTok> ExceptionListTokPtr;
-typedef ::IceUtil::Handle<ClassListTok> ClassListTokPtr;
-typedef ::IceUtil::Handle<EnumeratorListTok> EnumeratorListTokPtr;
-
-// ----------------------------------------------------------------------
-// StringTok
-// ----------------------------------------------------------------------
-
-class SLICE_API StringTok : public GrammarBase
-{
-public:
-
- StringTok() { }
- std::string v;
-};
-
-// ----------------------------------------------------------------------
-// StringListTok
-// ----------------------------------------------------------------------
-
-class SLICE_API StringListTok : public GrammarBase
-{
-public:
-
- StringListTok() { }
- StringList v;
-};
-
-// ----------------------------------------------------------------------
-// TypeStringTok
-// ----------------------------------------------------------------------
-
-class SLICE_API TypeStringTok : public GrammarBase
-{
-public:
-
- TypeStringTok() { }
- TypeString v;
-};
-
-// ----------------------------------------------------------------------
-// TypeStringListTok
-// ----------------------------------------------------------------------
-
-class SLICE_API TypeStringListTok : public GrammarBase
-{
-public:
-
- TypeStringListTok() { }
- TypeStringList v;
-};
-
-// ----------------------------------------------------------------------
-// BoolTok
-// ----------------------------------------------------------------------
-
-class SLICE_API BoolTok : public GrammarBase
-{
-public:
-
- BoolTok() { }
- bool v;
-};
-
-// ----------------------------------------------------------------------
-// ExceptionListTok
-// ----------------------------------------------------------------------
-
-class SLICE_API ExceptionListTok : public GrammarBase
-{
-public:
-
- ExceptionListTok() { }
- ExceptionList v;
-};
-
-// ----------------------------------------------------------------------
-// ClassListTok
-// ----------------------------------------------------------------------
-
-class SLICE_API ClassListTok : public GrammarBase
-{
-public:
-
- ClassListTok() { }
- ClassList v;
-};
-
-// ----------------------------------------------------------------------
-// EnumeratorListTok
-// ----------------------------------------------------------------------
-
-class SLICE_API EnumeratorListTok : public GrammarBase
-{
-public:
-
- EnumeratorListTok() { }
- EnumeratorList v;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef SLICE_GRAMMER_UTIL_H +#define SLICE_GRAMMER_UTIL_H + +#include <Slice/Parser.h> + +namespace Slice +{ + +class StringTok; +class StringListTok; +class TypeStringTok; +class TypeStringListTok; +class BoolTok; +class ExceptionListTok; +class ClassListTok; +class EnumeratorListTok; + +typedef ::IceUtil::Handle<StringTok> StringTokPtr; +typedef ::IceUtil::Handle<StringListTok> StringListTokPtr; +typedef ::IceUtil::Handle<TypeStringTok> TypeStringTokPtr; +typedef ::IceUtil::Handle<TypeStringListTok> TypeStringListTokPtr; +typedef ::IceUtil::Handle<BoolTok> BoolTokPtr; +typedef ::IceUtil::Handle<ExceptionListTok> ExceptionListTokPtr; +typedef ::IceUtil::Handle<ClassListTok> ClassListTokPtr; +typedef ::IceUtil::Handle<EnumeratorListTok> EnumeratorListTokPtr; + +// ---------------------------------------------------------------------- +// StringTok +// ---------------------------------------------------------------------- + +class SLICE_API StringTok : public GrammarBase +{ +public: + + StringTok() { } + std::string v; +}; + +// ---------------------------------------------------------------------- +// StringListTok +// ---------------------------------------------------------------------- + +class SLICE_API StringListTok : public GrammarBase +{ +public: + + StringListTok() { } + StringList v; +}; + +// ---------------------------------------------------------------------- +// TypeStringTok +// ---------------------------------------------------------------------- + +class SLICE_API TypeStringTok : public GrammarBase +{ +public: + + TypeStringTok() { } + TypeString v; +}; + +// ---------------------------------------------------------------------- +// TypeStringListTok +// ---------------------------------------------------------------------- + +class SLICE_API TypeStringListTok : public GrammarBase +{ +public: + + TypeStringListTok() { } + TypeStringList v; +}; + +// ---------------------------------------------------------------------- +// BoolTok +// ---------------------------------------------------------------------- + +class SLICE_API BoolTok : public GrammarBase +{ +public: + + BoolTok() { } + bool v; +}; + +// ---------------------------------------------------------------------- +// ExceptionListTok +// ---------------------------------------------------------------------- + +class SLICE_API ExceptionListTok : public GrammarBase +{ +public: + + ExceptionListTok() { } + ExceptionList v; +}; + +// ---------------------------------------------------------------------- +// ClassListTok +// ---------------------------------------------------------------------- + +class SLICE_API ClassListTok : public GrammarBase +{ +public: + + ClassListTok() { } + ClassList v; +}; + +// ---------------------------------------------------------------------- +// EnumeratorListTok +// ---------------------------------------------------------------------- + +class SLICE_API EnumeratorListTok : public GrammarBase +{ +public: + + EnumeratorListTok() { } + EnumeratorList v; +}; + +} + +#endif diff --git a/cpp/src/Slice/dummyinclude/unistd.h b/cpp/src/Slice/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/src/Slice/dummyinclude/unistd.h +++ b/cpp/src/Slice/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index 7e7d4abc0bb..71ca45f81cc 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -1,294 +1,294 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GEN_H
-#define GEN_H
-
-#include <Slice/Parser.h>
-#include <IceUtil/OutputUtil.h>
-
-namespace Slice
-{
-
-class Gen : public ::IceUtil::noncopyable
-{
-public:
-
- Gen(const std::string&,
- const std::string&,
- const std::string&,
- const std::vector<std::string>&,
- const std::string&,
- const std::string&,
- bool);
- ~Gen();
-
- bool operator!() const; // Returns true if there was a constructor error
-
- void generate(const UnitPtr&);
-
-private:
-
- ::IceUtil::Output H;
- ::IceUtil::Output C;
-
- ::IceUtil::Output implH;
- ::IceUtil::Output implC;
-
- std::string _base;
- std::string _include;
- std::vector<std::string> _includePaths;
- std::string _dllExport;
- bool _impl;
-
- class TypesVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- TypesVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual bool visitExceptionStart(const ExceptionPtr&);
- virtual void visitExceptionEnd(const ExceptionPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitStructEnd(const StructPtr&);
- virtual void visitSequence(const SequencePtr&);
- virtual void visitDictionary(const DictionaryPtr&);
- virtual void visitEnum(const EnumPtr&);
- virtual void visitDataMember(const DataMemberPtr&);
-
- private:
-
- void emitExceptionBase(const ExceptionPtr&, const std::string&);
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class ProxyDeclVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- ProxyDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual void visitClassDecl(const ClassDeclPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class ProxyVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- ProxyVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class DelegateVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- DelegateVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class DelegateMVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- DelegateMVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class DelegateDVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- DelegateDVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class ObjectDeclVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- ObjectDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual void visitClassDecl(const ClassDeclPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class ObjectVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- ObjectVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual bool visitExceptionStart(const ExceptionPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitOperation(const OperationPtr&);
- virtual void visitDataMember(const DataMemberPtr&);
-
- private:
-
- void emitClassBase(const ClassDefPtr&, const std::string&);
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class IceInternalVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- IceInternalVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual void visitClassDecl(const ClassDeclPtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class HandleVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- HandleVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual void visitClassDecl(const ClassDeclPtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
- };
-
- class ImplVisitor : public ::IceUtil::noncopyable, public ParserVisitor
- {
- public:
-
- ImplVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&);
-
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitModuleEnd(const ModulePtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
-
- private:
-
- ::IceUtil::Output& H;
- ::IceUtil::Output& C;
-
- std::string _dllExport;
-
- //
- // Generate code to return a dummy value
- //
- void writeReturn(::IceUtil::Output&, const TypePtr&);
- };
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GEN_H +#define GEN_H + +#include <Slice/Parser.h> +#include <IceUtil/OutputUtil.h> + +namespace Slice +{ + +class Gen : public ::IceUtil::noncopyable +{ +public: + + Gen(const std::string&, + const std::string&, + const std::string&, + const std::vector<std::string>&, + const std::string&, + const std::string&, + bool); + ~Gen(); + + bool operator!() const; // Returns true if there was a constructor error + + void generate(const UnitPtr&); + +private: + + ::IceUtil::Output H; + ::IceUtil::Output C; + + ::IceUtil::Output implH; + ::IceUtil::Output implC; + + std::string _base; + std::string _include; + std::vector<std::string> _includePaths; + std::string _dllExport; + bool _impl; + + class TypesVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + TypesVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + virtual void visitExceptionEnd(const ExceptionPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitStructEnd(const StructPtr&); + virtual void visitSequence(const SequencePtr&); + virtual void visitDictionary(const DictionaryPtr&); + virtual void visitEnum(const EnumPtr&); + virtual void visitDataMember(const DataMemberPtr&); + + private: + + void emitExceptionBase(const ExceptionPtr&, const std::string&); + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class ProxyDeclVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + ProxyDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class ProxyVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + ProxyVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class DelegateVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + DelegateVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class DelegateMVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + DelegateMVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class DelegateDVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + DelegateDVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class ObjectDeclVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + ObjectDeclVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class ObjectVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + ObjectVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitOperation(const OperationPtr&); + virtual void visitDataMember(const DataMemberPtr&); + + private: + + void emitClassBase(const ClassDefPtr&, const std::string&); + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class IceInternalVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + IceInternalVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class HandleVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + HandleVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + }; + + class ImplVisitor : public ::IceUtil::noncopyable, public ParserVisitor + { + public: + + ImplVisitor(::IceUtil::Output&, ::IceUtil::Output&, const std::string&); + + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + + private: + + ::IceUtil::Output& H; + ::IceUtil::Output& C; + + std::string _dllExport; + + // + // Generate code to return a dummy value + // + void writeReturn(::IceUtil::Output&, const TypePtr&); + }; +}; + +} + +#endif diff --git a/cpp/src/slice2docbook/Gen.h b/cpp/src/slice2docbook/Gen.h index e2fad7840d0..c4aa636875d 100644 --- a/cpp/src/slice2docbook/Gen.h +++ b/cpp/src/slice2docbook/Gen.h @@ -1,67 +1,67 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GEN_H
-#define GEN_H
-
-#include <Slice/Parser.h>
-#include <IceUtil/OutputUtil.h>
-#include <stack>
-
-namespace Slice
-{
-
-class Gen : public ::IceUtil::noncopyable, public ParserVisitor
-{
-public:
-
- Gen(const std::string&, const std::string&, bool, bool, bool);
- virtual ~Gen();
-
- bool operator!() const; // Returns true if there was a constructor error
-
- void generate(const UnitPtr&);
-
- virtual bool visitUnitStart(const UnitPtr&);
- virtual void visitUnitEnd(const UnitPtr&);
- virtual bool visitModuleStart(const ModulePtr&);
- virtual void visitContainer(const ContainerPtr&);
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual bool visitExceptionStart(const ExceptionPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitEnum(const EnumPtr&);
-
-private:
-
- void printHeader();
- std::string getComment(const ContainedPtr&, const ContainerPtr&, bool);
- StringList getTagged(const std::string&, std::string&);
- void printMetaData(const ContainedPtr&);
- void printComment(const ContainedPtr&);
- void printSummary(const ContainedPtr&);
- void start(const std::string&);
- void start(const std::string&, const std::string&);
- void end();
-
- std::string containedToId(const ContainedPtr&);
- std::string getScopedMinimized(const ContainedPtr&, const ContainerPtr&);
- std::string toString(const SyntaxTreeBasePtr&, const ContainerPtr&, bool = true);
- std::string toString(const std::string&, const ContainerPtr&, bool = true);
-
- ::IceUtil::XMLOutput O;
-
- bool _standAlone;
- bool _noGlobals;
- std::string _chapter;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GEN_H +#define GEN_H + +#include <Slice/Parser.h> +#include <IceUtil/OutputUtil.h> +#include <stack> + +namespace Slice +{ + +class Gen : public ::IceUtil::noncopyable, public ParserVisitor +{ +public: + + Gen(const std::string&, const std::string&, bool, bool, bool); + virtual ~Gen(); + + bool operator!() const; // Returns true if there was a constructor error + + void generate(const UnitPtr&); + + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual bool visitModuleStart(const ModulePtr&); + virtual void visitContainer(const ContainerPtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitEnum(const EnumPtr&); + +private: + + void printHeader(); + std::string getComment(const ContainedPtr&, const ContainerPtr&, bool); + StringList getTagged(const std::string&, std::string&); + void printMetaData(const ContainedPtr&); + void printComment(const ContainedPtr&); + void printSummary(const ContainedPtr&); + void start(const std::string&); + void start(const std::string&, const std::string&); + void end(); + + std::string containedToId(const ContainedPtr&); + std::string getScopedMinimized(const ContainedPtr&, const ContainerPtr&); + std::string toString(const SyntaxTreeBasePtr&, const ContainerPtr&, bool = true); + std::string toString(const std::string&, const ContainerPtr&, bool = true); + + ::IceUtil::XMLOutput O; + + bool _standAlone; + bool _noGlobals; + std::string _chapter; +}; + +} + +#endif diff --git a/cpp/src/slice2java/Gen.h b/cpp/src/slice2java/Gen.h index e08e1a08ccc..02e6128317e 100644 --- a/cpp/src/slice2java/Gen.h +++ b/cpp/src/slice2java/Gen.h @@ -1,244 +1,244 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GEN_H
-#define GEN_H
-
-#include <Slice/JavaUtil.h>
-
-namespace Slice
-{
-
-class JavaVisitor : public JavaGenerator, public ParserVisitor
-{
-public:
-
- virtual ~JavaVisitor();
-
-protected:
-
- JavaVisitor(const std::string&, const std::string&);
-
- //
- // Compose the parameter list for an operation
- //
- std::string getParams(const OperationPtr&, const std::string&);
-
- //
- // Compose the argument list for an operation
- //
- std::string getArgs(const OperationPtr&, const std::string&);
-
- //
- // Generate a throws clause containing only non-local exceptions
- //
- void writeThrowsClause(const std::string&, const ExceptionList&);
-
- //
- // Generate a throws clause for delegate operations containing only
- // non-local exceptions
- //
- void writeDelegateThrowsClause(const std::string&, const ExceptionList&);
-
- //
- // Generate code to compute a hash code for a type
- //
- void writeHashCode(::IceUtil::Output&, const TypePtr&, const std::string&, int&,
- const std::list<std::string>& = std::list<std::string>());
-
- //
- // Generate dispatch methods for a class or interface
- //
- void writeDispatch(::IceUtil::Output&, const ClassDefPtr&);
-};
-
-class Gen : public ::IceUtil::noncopyable
-{
-public:
-
- Gen(const std::string&,
- const std::string&,
- const std::vector<std::string>&,
- const std::string&,
- const std::string&,
- bool);
- ~Gen();
-
- bool operator!() const; // Returns true if there was a constructor error
-
- void generate(const UnitPtr&);
- void generateTie(const UnitPtr&);
- void generateImpl(const UnitPtr&);
- void generateImplTie(const UnitPtr&);
-
-private:
-
- std::string _base;
- std::vector<std::string> _includePaths;
- std::string _package;
- std::string _dir;
- bool _clone;
-
- class OpsVisitor : public JavaVisitor
- {
- public:
-
- OpsVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
- };
-
- class TieVisitor : public JavaVisitor
- {
- public:
-
- TieVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class TypesVisitor : public JavaVisitor
- {
- public:
-
- TypesVisitor(const std::string&, const std::string&, bool);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual bool visitExceptionStart(const ExceptionPtr&);
- virtual void visitExceptionEnd(const ExceptionPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitStructEnd(const StructPtr&);
- virtual void visitEnum(const EnumPtr&);
- virtual void visitDataMember(const DataMemberPtr&);
-
- private:
-
- bool _clone;
- };
-
- class HolderVisitor : public JavaVisitor
- {
- public:
-
- HolderVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitSequence(const SequencePtr&);
- virtual void visitDictionary(const DictionaryPtr&);
- virtual void visitEnum(const EnumPtr&);
-
- private:
-
- void writeHolder(const TypePtr&);
- };
-
- class HelperVisitor : public JavaVisitor
- {
- public:
-
- HelperVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitSequence(const SequencePtr&);
- virtual void visitDictionary(const DictionaryPtr&);
- };
-
- class ProxyVisitor : public JavaVisitor
- {
- public:
-
- ProxyVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual void visitClassDefEnd(const ClassDefPtr&);
- virtual void visitOperation(const OperationPtr&);
- };
-
- class DelegateVisitor : public JavaVisitor
- {
- public:
-
- DelegateVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class DelegateMVisitor : public JavaVisitor
- {
- public:
-
- DelegateMVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class DelegateDVisitor : public JavaVisitor
- {
- public:
-
- DelegateDVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class DispatcherVisitor : public JavaVisitor
- {
- public:
-
- DispatcherVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class BaseImplVisitor : public JavaVisitor
- {
- protected:
-
- //
- // Generate code to return a value
- //
- void writeReturn(::IceUtil::Output&, const TypePtr&);
-
- //
- // Generate an operation
- //
- void writeOperation(::IceUtil::Output&, const std::string&, const OperationPtr&, bool);
-
- public:
-
- BaseImplVisitor(const std::string&, const std::string&);
- };
-
- class ImplVisitor : public BaseImplVisitor
- {
- public:
-
- ImplVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-
- class ImplTieVisitor : public BaseImplVisitor
- {
- public:
-
- ImplTieVisitor(const std::string&, const std::string&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- };
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GEN_H +#define GEN_H + +#include <Slice/JavaUtil.h> + +namespace Slice +{ + +class JavaVisitor : public JavaGenerator, public ParserVisitor +{ +public: + + virtual ~JavaVisitor(); + +protected: + + JavaVisitor(const std::string&, const std::string&); + + // + // Compose the parameter list for an operation + // + std::string getParams(const OperationPtr&, const std::string&); + + // + // Compose the argument list for an operation + // + std::string getArgs(const OperationPtr&, const std::string&); + + // + // Generate a throws clause containing only non-local exceptions + // + void writeThrowsClause(const std::string&, const ExceptionList&); + + // + // Generate a throws clause for delegate operations containing only + // non-local exceptions + // + void writeDelegateThrowsClause(const std::string&, const ExceptionList&); + + // + // Generate code to compute a hash code for a type + // + void writeHashCode(::IceUtil::Output&, const TypePtr&, const std::string&, int&, + const std::list<std::string>& = std::list<std::string>()); + + // + // Generate dispatch methods for a class or interface + // + void writeDispatch(::IceUtil::Output&, const ClassDefPtr&); +}; + +class Gen : public ::IceUtil::noncopyable +{ +public: + + Gen(const std::string&, + const std::string&, + const std::vector<std::string>&, + const std::string&, + const std::string&, + bool); + ~Gen(); + + bool operator!() const; // Returns true if there was a constructor error + + void generate(const UnitPtr&); + void generateTie(const UnitPtr&); + void generateImpl(const UnitPtr&); + void generateImplTie(const UnitPtr&); + +private: + + std::string _base; + std::vector<std::string> _includePaths; + std::string _package; + std::string _dir; + bool _clone; + + class OpsVisitor : public JavaVisitor + { + public: + + OpsVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + }; + + class TieVisitor : public JavaVisitor + { + public: + + TieVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class TypesVisitor : public JavaVisitor + { + public: + + TypesVisitor(const std::string&, const std::string&, bool); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + virtual void visitExceptionEnd(const ExceptionPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitStructEnd(const StructPtr&); + virtual void visitEnum(const EnumPtr&); + virtual void visitDataMember(const DataMemberPtr&); + + private: + + bool _clone; + }; + + class HolderVisitor : public JavaVisitor + { + public: + + HolderVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitSequence(const SequencePtr&); + virtual void visitDictionary(const DictionaryPtr&); + virtual void visitEnum(const EnumPtr&); + + private: + + void writeHolder(const TypePtr&); + }; + + class HelperVisitor : public JavaVisitor + { + public: + + HelperVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitSequence(const SequencePtr&); + virtual void visitDictionary(const DictionaryPtr&); + }; + + class ProxyVisitor : public JavaVisitor + { + public: + + ProxyVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + }; + + class DelegateVisitor : public JavaVisitor + { + public: + + DelegateVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class DelegateMVisitor : public JavaVisitor + { + public: + + DelegateMVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class DelegateDVisitor : public JavaVisitor + { + public: + + DelegateDVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class DispatcherVisitor : public JavaVisitor + { + public: + + DispatcherVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class BaseImplVisitor : public JavaVisitor + { + protected: + + // + // Generate code to return a value + // + void writeReturn(::IceUtil::Output&, const TypePtr&); + + // + // Generate an operation + // + void writeOperation(::IceUtil::Output&, const std::string&, const OperationPtr&, bool); + + public: + + BaseImplVisitor(const std::string&, const std::string&); + }; + + class ImplVisitor : public BaseImplVisitor + { + public: + + ImplVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; + + class ImplTieVisitor : public BaseImplVisitor + { + public: + + ImplTieVisitor(const std::string&, const std::string&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + }; +}; + +} + +#endif diff --git a/cpp/src/slice2wsdl/Gen.h b/cpp/src/slice2wsdl/Gen.h index 8192dee73a2..e35402764ad 100644 --- a/cpp/src/slice2wsdl/Gen.h +++ b/cpp/src/slice2wsdl/Gen.h @@ -1,59 +1,59 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GEN_H
-#define GEN_H
-
-#include <Slice/Parser.h>
-#include <stack>
-
-namespace IceUtil
-{
-
-class XMLOutput;
-
-}
-
-namespace Slice
-{
-
-class Gen : public ::IceUtil::noncopyable, public ParserVisitor
-{
-public:
-
- Gen(const std::string&,
- const std::string&,
- const std::string&,
- const std::vector<std::string>&,
- const std::string&);
- virtual ~Gen();
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
-
-private:
-
- void emitMessage(::IceUtil::XMLOutput&, const OperationPtr&);
- void emitOperation(::IceUtil::XMLOutput&, const OperationPtr&);
-
- void printHeader(::IceUtil::XMLOutput&);
-
- std::string containedToId(const ContainedPtr&);
-
- std::string _name;
- std::string _base;
- std::string _include;
- std::string _orgName;
- std::vector<std::string> _includePaths;
- std::string _dir;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GEN_H +#define GEN_H + +#include <Slice/Parser.h> +#include <stack> + +namespace IceUtil +{ + +class XMLOutput; + +} + +namespace Slice +{ + +class Gen : public ::IceUtil::noncopyable, public ParserVisitor +{ +public: + + Gen(const std::string&, + const std::string&, + const std::string&, + const std::vector<std::string>&, + const std::string&); + virtual ~Gen(); + + virtual bool visitClassDefStart(const ClassDefPtr&); + +private: + + void emitMessage(::IceUtil::XMLOutput&, const OperationPtr&); + void emitOperation(::IceUtil::XMLOutput&, const OperationPtr&); + + void printHeader(::IceUtil::XMLOutput&); + + std::string containedToId(const ContainedPtr&); + + std::string _name; + std::string _base; + std::string _include; + std::string _orgName; + std::vector<std::string> _includePaths; + std::string _dir; +}; + +} + +#endif diff --git a/cpp/src/slice2xsd/Gen.h b/cpp/src/slice2xsd/Gen.h index 2bfb2d5c9f2..aedc4c3af95 100644 --- a/cpp/src/slice2xsd/Gen.h +++ b/cpp/src/slice2xsd/Gen.h @@ -1,63 +1,63 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef GEN_H
-#define GEN_H
-
-#include <Slice/Parser.h>
-#include <IceUtil/OutputUtil.h>
-#include <stack>
-
-namespace Slice
-{
-
-class Gen : public ::IceUtil::noncopyable, public ParserVisitor
-{
-public:
-
- Gen(const std::string&,
- const std::string&,
- const std::string&,
- const std::vector<std::string>&,
- const std::string&);
- virtual ~Gen();
-
- bool operator!() const; // Returns true if there was a constructor error
-
- void generate(const UnitPtr&);
-
- virtual bool visitClassDefStart(const ClassDefPtr&);
- virtual bool visitExceptionStart(const ExceptionPtr&);
- virtual bool visitStructStart(const StructPtr&);
- virtual void visitOperation(const OperationPtr&);
- virtual void visitEnum(const EnumPtr&);
- virtual void visitSequence(const SequencePtr&);
- virtual void visitDictionary(const DictionaryPtr&);
-
-private:
-
- void printHeader();
- void annotate(const ::std::string&);
- void emitElement(const ::std::string&, const TypePtr&);
-
- std::string containedToId(const ContainedPtr&);
- std::string toString(const SyntaxTreeBasePtr&);
-
- ::IceUtil::XMLOutput O;
-
- std::string _base;
- std::string _include;
- std::string _orgName;
- std::vector<std::string> _includePaths;
-};
-
-}
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef GEN_H +#define GEN_H + +#include <Slice/Parser.h> +#include <IceUtil/OutputUtil.h> +#include <stack> + +namespace Slice +{ + +class Gen : public ::IceUtil::noncopyable, public ParserVisitor +{ +public: + + Gen(const std::string&, + const std::string&, + const std::string&, + const std::vector<std::string>&, + const std::string&); + virtual ~Gen(); + + bool operator!() const; // Returns true if there was a constructor error + + void generate(const UnitPtr&); + + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); + virtual bool visitStructStart(const StructPtr&); + virtual void visitOperation(const OperationPtr&); + virtual void visitEnum(const EnumPtr&); + virtual void visitSequence(const SequencePtr&); + virtual void visitDictionary(const DictionaryPtr&); + +private: + + void printHeader(); + void annotate(const ::std::string&); + void emitElement(const ::std::string&, const TypePtr&); + + std::string containedToId(const ContainedPtr&); + std::string toString(const SyntaxTreeBasePtr&); + + ::IceUtil::XMLOutput O; + + std::string _base; + std::string _include; + std::string _orgName; + std::vector<std::string> _includePaths; +}; + +} + +#endif diff --git a/cpp/test/Freeze/complex/NodeI.h b/cpp/test/Freeze/complex/NodeI.h index e1c091f24f9..703ff7247e2 100644 --- a/cpp/test/Freeze/complex/NodeI.h +++ b/cpp/test/Freeze/complex/NodeI.h @@ -1,110 +1,110 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef NODE_I_H
-#define NODE_I_H
-
-#include <Complex.h>
-#include <Ice/ObjectFactory.h>
-
-namespace Complex
-{
-
-class NumberNodeI : public NumberNode
-{
-public:
-
- NumberNodeI()
- {
- }
-
- NumberNodeI(int number)
- {
- _number = number;
- }
-
- virtual int calc(const Ice::Current&)
- {
- return _number;
- }
-};
-
-class AddNodeI : public AddNode
-{
-public:
-
- AddNodeI()
- {
- }
-
- AddNodeI(const NodePtr& left, const NodePtr& right)
- {
- _left = left;
- _right = right;
- }
-
- virtual int calc(const Ice::Current&)
- {
- return _left->calc() + _right->calc();
- }
-};
-
-class MultiplyNodeI : public MultiplyNode
-{
-public:
-
- MultiplyNodeI()
- {
- }
-
- MultiplyNodeI(const NodePtr& left, const NodePtr& right)
- {
- _left = left;
- _right = right;
- }
-
- virtual int calc(const Ice::Current&)
- {
- return _left->calc() * _right->calc();
- }
-};
-
-class ObjectFactoryI : public Ice::ObjectFactory
-{
-public:
-
- virtual Ice::ObjectPtr create(const std::string& type)
- {
- if(type == "::Complex::MultiplyNode")
- {
- return new MultiplyNodeI();
- }
- if(type == "::Complex::AddNode")
- {
- return new AddNodeI();
- }
- if(type == "::Complex::NumberNode")
- {
- return new NumberNodeI();
- }
- std::cout << "create: " << type << std::endl;
- assert(false);
- return 0;
- }
-
- virtual void destroy()
- {
- // Nothing to do
- }
-};
-
-} // End namespace Complex
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef NODE_I_H +#define NODE_I_H + +#include <Complex.h> +#include <Ice/ObjectFactory.h> + +namespace Complex +{ + +class NumberNodeI : public NumberNode +{ +public: + + NumberNodeI() + { + } + + NumberNodeI(int number) + { + _number = number; + } + + virtual int calc(const Ice::Current&) + { + return _number; + } +}; + +class AddNodeI : public AddNode +{ +public: + + AddNodeI() + { + } + + AddNodeI(const NodePtr& left, const NodePtr& right) + { + _left = left; + _right = right; + } + + virtual int calc(const Ice::Current&) + { + return _left->calc() + _right->calc(); + } +}; + +class MultiplyNodeI : public MultiplyNode +{ +public: + + MultiplyNodeI() + { + } + + MultiplyNodeI(const NodePtr& left, const NodePtr& right) + { + _left = left; + _right = right; + } + + virtual int calc(const Ice::Current&) + { + return _left->calc() * _right->calc(); + } +}; + +class ObjectFactoryI : public Ice::ObjectFactory +{ +public: + + virtual Ice::ObjectPtr create(const std::string& type) + { + if(type == "::Complex::MultiplyNode") + { + return new MultiplyNodeI(); + } + if(type == "::Complex::AddNode") + { + return new AddNodeI(); + } + if(type == "::Complex::NumberNode") + { + return new NumberNodeI(); + } + std::cout << "create: " << type << std::endl; + assert(false); + return 0; + } + + virtual void destroy() + { + // Nothing to do + } +}; + +} // End namespace Complex + +#endif diff --git a/cpp/test/Freeze/complex/Parser.h b/cpp/test/Freeze/complex/Parser.h index ba140f668c6..53898734009 100644 --- a/cpp/test/Freeze/complex/Parser.h +++ b/cpp/test/Freeze/complex/Parser.h @@ -1,79 +1,79 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef PARSER_H
-#define PARSER_H
-
-#include <Complex.h>
-
-#ifdef _WIN32
-# include <io.h>
-# define isatty _isatty
-# define fileno _fileno
-// '_isatty' : inconsistent dll linkage. dllexport assumed.
-# pragma warning( disable : 4273 )
-#endif
-
-//
-// Stuff for flex and bison
-//
-
-#define YYSTYPE Complex::NodePtr
-#define YY_DECL int yylex(YYSTYPE* yylvalp)
-YY_DECL;
-int yyparse();
-
-//
-// I must set the initial stack depth to the maximum stack depth to
-// disable bison stack resizing. The bison stack resizing routines use
-// simple malloc/alloc/memcpy calls, which do not work for the
-// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor,
-// assignment operator, etc.
-//
-#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum.
-#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above.
-
-//
-// Newer bison versions allow to disable stack resizing by defining
-// yyoverflow.
-//
-#define yyoverflow(a, b, c, d, e, f) yyerror(a)
-
-//
-// unput() isn't needed. This prevents the function being defined, and
-// the resulting compiler warning.
-//
-#define YY_NO_UNPUT
-
-class Parser
-{
-public:
-
- Parser();
- ~Parser();
-
- Complex::NodePtr parse(const std::string&, bool = false);
-
- void error(const char*);
- void error(const std::string&);
-
- void getInput(char*, int&, int);
- void setResult(const Complex::NodePtr&);
-
-private:
-
- std::string _buf;
- Complex::NodePtr _result;
- int _errors;
-};
-
-extern Parser* parser; // Current parser for bison/flex
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef PARSER_H +#define PARSER_H + +#include <Complex.h> + +#ifdef _WIN32 +# include <io.h> +# define isatty _isatty +# define fileno _fileno +// '_isatty' : inconsistent dll linkage. dllexport assumed. +# pragma warning( disable : 4273 ) +#endif + +// +// Stuff for flex and bison +// + +#define YYSTYPE Complex::NodePtr +#define YY_DECL int yylex(YYSTYPE* yylvalp) +YY_DECL; +int yyparse(); + +// +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +// +#define YYMAXDEPTH 20000 // 20000 should suffice. Bison default is 10000 as maximum. +#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. + +// +// Newer bison versions allow to disable stack resizing by defining +// yyoverflow. +// +#define yyoverflow(a, b, c, d, e, f) yyerror(a) + +// +// unput() isn't needed. This prevents the function being defined, and +// the resulting compiler warning. +// +#define YY_NO_UNPUT + +class Parser +{ +public: + + Parser(); + ~Parser(); + + Complex::NodePtr parse(const std::string&, bool = false); + + void error(const char*); + void error(const std::string&); + + void getInput(char*, int&, int); + void setResult(const Complex::NodePtr&); + +private: + + std::string _buf; + Complex::NodePtr _result; + int _errors; +}; + +extern Parser* parser; // Current parser for bison/flex + +#endif diff --git a/cpp/test/Freeze/complex/dummyinclude/unistd.h b/cpp/test/Freeze/complex/dummyinclude/unistd.h index a5868056a35..92d53d10b9b 100644 --- a/cpp/test/Freeze/complex/dummyinclude/unistd.h +++ b/cpp/test/Freeze/complex/dummyinclude/unistd.h @@ -1,4 +1,4 @@ -//
-// Files generated by flex need unistd.h, which is not available on
-// Windows. Thus this dummy file.
-//
+// +// Files generated by flex need unistd.h, which is not available on +// Windows. Thus this dummy file. +// diff --git a/cpp/test/Glacier/starter/CallbackI.h b/cpp/test/Glacier/starter/CallbackI.h index 72b67994798..f8ad0fd68f8 100644 --- a/cpp/test/Glacier/starter/CallbackI.h +++ b/cpp/test/Glacier/starter/CallbackI.h @@ -1,48 +1,48 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CALLBACK_I_H
-#define CALLBACK_I_H
-
-#include <IceUtil/Mutex.h>
-#include <IceUtil/Monitor.h>
-#include <Callback.h>
-
-class CallbackReceiverI : public CallbackReceiver, IceUtil::Monitor<IceUtil::Mutex>
-{
-public:
-
- CallbackReceiverI();
-
- virtual void callback(const Ice::Current&);
- virtual void callbackEx(const Ice::Current&);
- bool callbackOK();
-
-private:
-
- bool _callback;
-};
-
-class CallbackI : public Callback
-{
-public:
-
- CallbackI(const Ice::CommunicatorPtr&);
-
- virtual void initiateCallback(const CallbackReceiverPrx&, const Ice::Current&);
- virtual void initiateCallbackEx(const CallbackReceiverPrx&, const Ice::Current&);
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CALLBACK_I_H +#define CALLBACK_I_H + +#include <IceUtil/Mutex.h> +#include <IceUtil/Monitor.h> +#include <Callback.h> + +class CallbackReceiverI : public CallbackReceiver, IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + CallbackReceiverI(); + + virtual void callback(const Ice::Current&); + virtual void callbackEx(const Ice::Current&); + bool callbackOK(); + +private: + + bool _callback; +}; + +class CallbackI : public Callback +{ +public: + + CallbackI(const Ice::CommunicatorPtr&); + + virtual void initiateCallback(const CallbackReceiverPrx&, const Ice::Current&); + virtual void initiateCallbackEx(const CallbackReceiverPrx&, const Ice::Current&); + virtual void shutdown(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +#endif diff --git a/cpp/test/Ice/exceptions/TestI.h b/cpp/test/Ice/exceptions/TestI.h index ec7415ac750..afd6095ddc7 100644 --- a/cpp/test/Ice/exceptions/TestI.h +++ b/cpp/test/Ice/exceptions/TestI.h @@ -1,42 +1,42 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class ThrowerI : public Thrower
-{
-public:
-
- ThrowerI(const Ice::ObjectAdapterPtr&);
-
- virtual void shutdown(const Ice::Current&);
- virtual void throwAasA(Ice::Int, const Ice::Current&);
- virtual void throwAorDasAorD(Ice::Int, const Ice::Current&);
- virtual void throwBasA(Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwCasA(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwBasB(Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwCasB(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwCasC(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&);
- virtual bool supportsUndeclaredExceptions(const Ice::Current&);
- virtual void throwUndeclaredA(Ice::Int, const Ice::Current&);
- virtual void throwUndeclaredB(Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwUndeclaredC(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&);
- virtual void throwLocalException(const Ice::Current&);
- virtual void throwNonIceException(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class ThrowerI : public Thrower +{ +public: + + ThrowerI(const Ice::ObjectAdapterPtr&); + + virtual void shutdown(const Ice::Current&); + virtual void throwAasA(Ice::Int, const Ice::Current&); + virtual void throwAorDasAorD(Ice::Int, const Ice::Current&); + virtual void throwBasA(Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwCasA(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwBasB(Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwCasB(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwCasC(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + virtual bool supportsUndeclaredExceptions(const Ice::Current&); + virtual void throwUndeclaredA(Ice::Int, const Ice::Current&); + virtual void throwUndeclaredB(Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwUndeclaredC(Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + virtual void throwLocalException(const Ice::Current&); + virtual void throwNonIceException(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; +}; + +#endif diff --git a/cpp/test/Ice/facets/TestI.h b/cpp/test/Ice/facets/TestI.h index ba4ba0ee4f4..4187cd07f96 100644 --- a/cpp/test/Ice/facets/TestI.h +++ b/cpp/test/Ice/facets/TestI.h @@ -1,71 +1,71 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class AI : virtual public A
-{
-public:
-
- virtual std::string callA(const Ice::Current&);
-};
-
-class BI : virtual public B, virtual public AI
-{
-public:
-
- virtual std::string callB(const Ice::Current&);
-};
-
-class CI : virtual public C, virtual public AI
-{
-public:
-
- virtual std::string callC(const Ice::Current&);
-};
-
-class DI : virtual public D, virtual public BI, virtual public CI
-{
-public:
-
- virtual std::string callD(const Ice::Current&);
-};
-
-class EI : virtual public E
-{
-public:
-
- virtual std::string callE(const Ice::Current&);
-};
-
-class FI : virtual public F, virtual public EI
-{
-public:
-
- virtual std::string callF(const Ice::Current&);
-};
-
-class GI : virtual public G
-{
-public:
-
- GI(const Ice::CommunicatorPtr&);
- virtual void shutdown(const Ice::Current&);
- virtual std::string callG(const Ice::Current&);
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class AI : virtual public A +{ +public: + + virtual std::string callA(const Ice::Current&); +}; + +class BI : virtual public B, virtual public AI +{ +public: + + virtual std::string callB(const Ice::Current&); +}; + +class CI : virtual public C, virtual public AI +{ +public: + + virtual std::string callC(const Ice::Current&); +}; + +class DI : virtual public D, virtual public BI, virtual public CI +{ +public: + + virtual std::string callD(const Ice::Current&); +}; + +class EI : virtual public E +{ +public: + + virtual std::string callE(const Ice::Current&); +}; + +class FI : virtual public F, virtual public EI +{ +public: + + virtual std::string callF(const Ice::Current&); +}; + +class GI : virtual public G +{ +public: + + GI(const Ice::CommunicatorPtr&); + virtual void shutdown(const Ice::Current&); + virtual std::string callG(const Ice::Current&); + +private: + + Ice::CommunicatorPtr _communicator; +}; + +#endif diff --git a/cpp/test/Ice/faultTolerance/TestI.h b/cpp/test/Ice/faultTolerance/TestI.h index f54518cfd2d..92e6e9fb225 100644 --- a/cpp/test/Ice/faultTolerance/TestI.h +++ b/cpp/test/Ice/faultTolerance/TestI.h @@ -1,32 +1,32 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class TestI : public Test
-{
-public:
-
- TestI(const Ice::ObjectAdapterPtr&);
-
- virtual void shutdown(const Ice::Current&);
- virtual void abort(const Ice::Current&);
- virtual void nonmutatingAbort(const Ice::Current&);
- virtual Ice::Int pid(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class TestI : public Test +{ +public: + + TestI(const Ice::ObjectAdapterPtr&); + + virtual void shutdown(const Ice::Current&); + virtual void abort(const Ice::Current&); + virtual void nonmutatingAbort(const Ice::Current&); + virtual Ice::Int pid(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; +}; + +#endif diff --git a/cpp/test/Ice/inheritance/TestI.h b/cpp/test/Ice/inheritance/TestI.h index b245993316a..f6c0da1d649 100644 --- a/cpp/test/Ice/inheritance/TestI.h +++ b/cpp/test/Ice/inheritance/TestI.h @@ -1,102 +1,102 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class InitialI : public Initial
-{
-public:
-
- InitialI(const Ice::ObjectAdapterPtr&);
-
- virtual void shutdown(const Ice::Current&);
-
- virtual M_A::C_APrx c_a(const Ice::Current&);
- virtual M_B::C_BPrx c_b(const Ice::Current&);
- virtual M_A::C_CPrx c_c(const Ice::Current&);
- virtual M_A::C_DPrx c_d(const Ice::Current&);
- virtual M_A::I_APrx i_a(const Ice::Current&);
- virtual M_B::I_B1Prx i_b1(const Ice::Current&);
- virtual M_B::I_B2Prx i_b2(const Ice::Current&);
- virtual M_A::I_CPrx i_c(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- M_A::C_APrx _ca;
- M_B::C_BPrx _cb;
- M_A::C_CPrx _cc;
- M_A::C_DPrx _cd;
- M_A::I_APrx _ia;
- M_B::I_B1Prx _ib1;
- M_B::I_B2Prx _ib2;
- M_A::I_CPrx _ic;
-};
-
-class C_A_I : virtual public M_A::C_A
-{
-public:
-
- virtual M_A::C_APrx ca(const M_A::C_APrx&, const Ice::Current&);
-};
-
-class C_B_I : virtual public M_B::C_B, virtual public C_A_I
-{
-public:
-
- virtual M_B::C_BPrx cb(const M_B::C_BPrx&, const Ice::Current&);
-};
-
-class C_C_I : virtual public M_A::C_C, virtual public C_B_I
-{
-public:
-
- virtual M_A::C_CPrx cc(const M_A::C_CPrx&, const Ice::Current&);
-};
-
-class I_A_I : virtual public M_A::I_A
-{
-public:
-
- virtual M_A::I_APrx ia(const M_A::I_APrx&, const Ice::Current&);
-};
-
-class I_B1_I : virtual public M_B::I_B1, virtual public I_A_I
-{
-public:
-
- virtual M_B::I_B1Prx ib1(const M_B::I_B1Prx&, const Ice::Current&);
-};
-
-class I_B2_I : virtual public M_B::I_B2, virtual public I_A_I
-{
-public:
-
- virtual M_B::I_B2Prx ib2(const M_B::I_B2Prx&, const Ice::Current&);
-};
-
-class I_C_I : virtual public M_A::I_C, virtual public I_B1_I, virtual public I_B2_I
-{
-public:
-
- virtual M_A::I_CPrx ic(const M_A::I_CPrx&, const Ice::Current&);
-};
-
-class C_D_I : virtual public M_A::C_D, virtual public C_C_I, virtual public I_B1_I, virtual public I_B2_I
-{
-public:
-
- virtual M_A::C_DPrx cd(const M_A::C_DPrx&, const Ice::Current&);
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class InitialI : public Initial +{ +public: + + InitialI(const Ice::ObjectAdapterPtr&); + + virtual void shutdown(const Ice::Current&); + + virtual M_A::C_APrx c_a(const Ice::Current&); + virtual M_B::C_BPrx c_b(const Ice::Current&); + virtual M_A::C_CPrx c_c(const Ice::Current&); + virtual M_A::C_DPrx c_d(const Ice::Current&); + virtual M_A::I_APrx i_a(const Ice::Current&); + virtual M_B::I_B1Prx i_b1(const Ice::Current&); + virtual M_B::I_B2Prx i_b2(const Ice::Current&); + virtual M_A::I_CPrx i_c(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; + M_A::C_APrx _ca; + M_B::C_BPrx _cb; + M_A::C_CPrx _cc; + M_A::C_DPrx _cd; + M_A::I_APrx _ia; + M_B::I_B1Prx _ib1; + M_B::I_B2Prx _ib2; + M_A::I_CPrx _ic; +}; + +class C_A_I : virtual public M_A::C_A +{ +public: + + virtual M_A::C_APrx ca(const M_A::C_APrx&, const Ice::Current&); +}; + +class C_B_I : virtual public M_B::C_B, virtual public C_A_I +{ +public: + + virtual M_B::C_BPrx cb(const M_B::C_BPrx&, const Ice::Current&); +}; + +class C_C_I : virtual public M_A::C_C, virtual public C_B_I +{ +public: + + virtual M_A::C_CPrx cc(const M_A::C_CPrx&, const Ice::Current&); +}; + +class I_A_I : virtual public M_A::I_A +{ +public: + + virtual M_A::I_APrx ia(const M_A::I_APrx&, const Ice::Current&); +}; + +class I_B1_I : virtual public M_B::I_B1, virtual public I_A_I +{ +public: + + virtual M_B::I_B1Prx ib1(const M_B::I_B1Prx&, const Ice::Current&); +}; + +class I_B2_I : virtual public M_B::I_B2, virtual public I_A_I +{ +public: + + virtual M_B::I_B2Prx ib2(const M_B::I_B2Prx&, const Ice::Current&); +}; + +class I_C_I : virtual public M_A::I_C, virtual public I_B1_I, virtual public I_B2_I +{ +public: + + virtual M_A::I_CPrx ic(const M_A::I_CPrx&, const Ice::Current&); +}; + +class C_D_I : virtual public M_A::C_D, virtual public C_C_I, virtual public I_B1_I, virtual public I_B2_I +{ +public: + + virtual M_A::C_DPrx cd(const M_A::C_DPrx&, const Ice::Current&); +}; + +#endif diff --git a/cpp/test/Ice/locationForward/TestI.h b/cpp/test/Ice/locationForward/TestI.h index 6a6eeff4019..7613c42d1fb 100644 --- a/cpp/test/Ice/locationForward/TestI.h +++ b/cpp/test/Ice/locationForward/TestI.h @@ -1,30 +1,30 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class TestI : public Test
-{
-public:
-
- TestI(const Ice::ObjectAdapterPtr&, const Ice::ObjectPrx);
-
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- Ice::ObjectPrx _fwd;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class TestI : public Test +{ +public: + + TestI(const Ice::ObjectAdapterPtr&, const Ice::ObjectPrx); + + virtual void shutdown(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; + Ice::ObjectPrx _fwd; +}; + +#endif diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h index 549bf17f805..f5b8caf77de 100644 --- a/cpp/test/Ice/objects/TestI.h +++ b/cpp/test/Ice/objects/TestI.h @@ -1,39 +1,39 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class InitialI : public Initial
-{
-public:
-
- InitialI(const Ice::ObjectAdapterPtr&);
-
- virtual void shutdown(const Ice::Current&);
- virtual BPtr getB1(const Ice::Current&);
- virtual BPtr getB2(const Ice::Current&);
- virtual CPtr getC(const Ice::Current&);
- virtual DPtr getD(const Ice::Current&);
- virtual void getAll(BPtr&, BPtr&, CPtr&, DPtr&, const Ice::Current&);
- virtual void addFacetsToB1(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- BPtr _b1;
- BPtr _b2;
- CPtr _c;
- DPtr _d;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class InitialI : public Initial +{ +public: + + InitialI(const Ice::ObjectAdapterPtr&); + + virtual void shutdown(const Ice::Current&); + virtual BPtr getB1(const Ice::Current&); + virtual BPtr getB2(const Ice::Current&); + virtual CPtr getC(const Ice::Current&); + virtual DPtr getD(const Ice::Current&); + virtual void getAll(BPtr&, BPtr&, CPtr&, DPtr&, const Ice::Current&); + virtual void addFacetsToB1(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; + BPtr _b1; + BPtr _b2; + CPtr _c; + DPtr _d; +}; + +#endif diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 4eb2476351a..33058813a05 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -1,161 +1,161 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class MyDerivedClassI : public Test::MyDerivedClass
-{
-public:
-
- MyDerivedClassI(const Ice::ObjectAdapterPtr&, const Ice::Identity&);
-
- virtual void shutdown(const Ice::Current&);
-
- virtual void opVoid(const Ice::Current&);
-
- virtual Ice::Byte opByte(Ice::Byte,
- Ice::Byte,
- Ice::Byte&,
- const Ice::Current&);
-
- virtual bool opBool(bool,
- bool,
- bool&,
- const Ice::Current&);
-
- virtual Ice::Long opShortIntLong(Ice::Short,
- Ice::Int,
- Ice::Long,
- Ice::Short&,
- Ice::Int&,
- Ice::Long&,
- const Ice::Current&);
-
- virtual Ice::Double opFloatDouble(Ice::Float,
- Ice::Double,
- Ice::Float&,
- Ice::Double&,
- const Ice::Current&);
-
- virtual std::string opString(const std::string&,
- const std::string&,
- std::string&,
- const Ice::Current&);
-
- virtual Test::MyEnum opMyEnum(Test::MyEnum,
- Test::MyEnum&,
- const Ice::Current&);
-
- virtual Test::MyClassPrx opMyClass(const Test::MyClassPrx&,
- Test::MyClassPrx&, Test::MyClassPrx&,
- const Ice::Current&);
-
- virtual Test::Struct opStruct(const Test::Struct&, const Test::Struct&,
- Test::Struct&,
- const Ice::Current&);
-
- virtual Test::ByteS opByteS(const Test::ByteS&,
- const Test::ByteS&,
- Test::ByteS&,
- const Ice::Current&);
-
- virtual Test::BoolS opBoolS(const Test::BoolS&,
- const Test::BoolS&,
- Test::BoolS&,
- const Ice::Current&);
-
- virtual Test::LongS opShortIntLongS(const Test::ShortS&,
- const Test::IntS&,
- const Test::LongS&,
- Test::ShortS&,
- Test::IntS&,
- Test::LongS&,
- const Ice::Current&);
-
- virtual Test::DoubleS opFloatDoubleS(const Test::FloatS&,
- const Test::DoubleS&,
- Test::FloatS&,
- Test::DoubleS&,
- const Ice::Current&);
-
- virtual Test::StringS opStringS(const Test::StringS&,
- const Test::StringS&,
- Test::StringS&,
- const Ice::Current&);
-
- virtual Test::ByteSS opByteSS(const Test::ByteSS&,
- const Test::ByteSS&,
- Test::ByteSS&,
- const Ice::Current&);
-
- virtual Test::BoolSS opBoolSS(const Test::BoolSS&,
- const Test::BoolSS&,
- Test::BoolSS&,
- const Ice::Current&);
-
- virtual Test::LongSS opShortIntLongSS(const Test::ShortSS&,
- const Test::IntSS&,
- const Test::LongSS&,
- Test::ShortSS&,
- Test::IntSS&,
- Test::LongSS&,
- const Ice::Current&);
-
- virtual Test::DoubleSS opFloatDoubleSS(const Test::FloatSS&,
- const Test::DoubleSS&,
- Test::FloatSS&,
- Test::DoubleSS&,
- const Ice::Current&);
-
- virtual Test::StringSS opStringSS(const Test::StringSS&,
- const Test::StringSS&,
- Test::StringSS&,
- const Ice::Current&);
-
- virtual Test::ByteBoolD opByteBoolD(const Test::ByteBoolD&, const Test::ByteBoolD&,
- Test::ByteBoolD&,
- const Ice::Current&);
-
- virtual Test::ShortIntD opShortIntD(const Test::ShortIntD&, const Test::ShortIntD&,
- Test::ShortIntD&,
- const Ice::Current&);
-
- virtual Test::LongFloatD opLongFloatD(const Test::LongFloatD&, const Test::LongFloatD&,
- Test::LongFloatD&,
- const Ice::Current&);
-
- virtual Test::DoubleStringD opDoubleStringD(const Test::DoubleStringD&, const Test::DoubleStringD&,
- Test::DoubleStringD&,
- const Ice::Current&);
-
- virtual Test::StringStringD opStringStringD(const Test::StringStringD&, const Test::StringStringD&,
- Test::StringStringD&,
- const Ice::Current&);
-
- virtual Test::StringMyEnumD opStringMyEnumD(const Test::StringMyEnumD&, const Test::StringMyEnumD&,
- Test::StringMyEnumD&,
- const Ice::Current&);
-
- virtual Test::MyClassStringD opMyClassStringD(const Test::MyClassStringD&, const Test::MyClassStringD&,
- Test::MyClassStringD&,
- const Ice::Current&);
-
- virtual void opDerived(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
- Ice::Identity _identity;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class MyDerivedClassI : public Test::MyDerivedClass +{ +public: + + MyDerivedClassI(const Ice::ObjectAdapterPtr&, const Ice::Identity&); + + virtual void shutdown(const Ice::Current&); + + virtual void opVoid(const Ice::Current&); + + virtual Ice::Byte opByte(Ice::Byte, + Ice::Byte, + Ice::Byte&, + const Ice::Current&); + + virtual bool opBool(bool, + bool, + bool&, + const Ice::Current&); + + virtual Ice::Long opShortIntLong(Ice::Short, + Ice::Int, + Ice::Long, + Ice::Short&, + Ice::Int&, + Ice::Long&, + const Ice::Current&); + + virtual Ice::Double opFloatDouble(Ice::Float, + Ice::Double, + Ice::Float&, + Ice::Double&, + const Ice::Current&); + + virtual std::string opString(const std::string&, + const std::string&, + std::string&, + const Ice::Current&); + + virtual Test::MyEnum opMyEnum(Test::MyEnum, + Test::MyEnum&, + const Ice::Current&); + + virtual Test::MyClassPrx opMyClass(const Test::MyClassPrx&, + Test::MyClassPrx&, Test::MyClassPrx&, + const Ice::Current&); + + virtual Test::Struct opStruct(const Test::Struct&, const Test::Struct&, + Test::Struct&, + const Ice::Current&); + + virtual Test::ByteS opByteS(const Test::ByteS&, + const Test::ByteS&, + Test::ByteS&, + const Ice::Current&); + + virtual Test::BoolS opBoolS(const Test::BoolS&, + const Test::BoolS&, + Test::BoolS&, + const Ice::Current&); + + virtual Test::LongS opShortIntLongS(const Test::ShortS&, + const Test::IntS&, + const Test::LongS&, + Test::ShortS&, + Test::IntS&, + Test::LongS&, + const Ice::Current&); + + virtual Test::DoubleS opFloatDoubleS(const Test::FloatS&, + const Test::DoubleS&, + Test::FloatS&, + Test::DoubleS&, + const Ice::Current&); + + virtual Test::StringS opStringS(const Test::StringS&, + const Test::StringS&, + Test::StringS&, + const Ice::Current&); + + virtual Test::ByteSS opByteSS(const Test::ByteSS&, + const Test::ByteSS&, + Test::ByteSS&, + const Ice::Current&); + + virtual Test::BoolSS opBoolSS(const Test::BoolSS&, + const Test::BoolSS&, + Test::BoolSS&, + const Ice::Current&); + + virtual Test::LongSS opShortIntLongSS(const Test::ShortSS&, + const Test::IntSS&, + const Test::LongSS&, + Test::ShortSS&, + Test::IntSS&, + Test::LongSS&, + const Ice::Current&); + + virtual Test::DoubleSS opFloatDoubleSS(const Test::FloatSS&, + const Test::DoubleSS&, + Test::FloatSS&, + Test::DoubleSS&, + const Ice::Current&); + + virtual Test::StringSS opStringSS(const Test::StringSS&, + const Test::StringSS&, + Test::StringSS&, + const Ice::Current&); + + virtual Test::ByteBoolD opByteBoolD(const Test::ByteBoolD&, const Test::ByteBoolD&, + Test::ByteBoolD&, + const Ice::Current&); + + virtual Test::ShortIntD opShortIntD(const Test::ShortIntD&, const Test::ShortIntD&, + Test::ShortIntD&, + const Ice::Current&); + + virtual Test::LongFloatD opLongFloatD(const Test::LongFloatD&, const Test::LongFloatD&, + Test::LongFloatD&, + const Ice::Current&); + + virtual Test::DoubleStringD opDoubleStringD(const Test::DoubleStringD&, const Test::DoubleStringD&, + Test::DoubleStringD&, + const Ice::Current&); + + virtual Test::StringStringD opStringStringD(const Test::StringStringD&, const Test::StringStringD&, + Test::StringStringD&, + const Ice::Current&); + + virtual Test::StringMyEnumD opStringMyEnumD(const Test::StringMyEnumD&, const Test::StringMyEnumD&, + Test::StringMyEnumD&, + const Ice::Current&); + + virtual Test::MyClassStringD opMyClassStringD(const Test::MyClassStringD&, const Test::MyClassStringD&, + Test::MyClassStringD&, + const Ice::Current&); + + virtual void opDerived(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; + Ice::Identity _identity; +}; + +#endif diff --git a/cpp/test/IcePack/simple/TestI.h b/cpp/test/IcePack/simple/TestI.h index 026b17a7ffa..61a45f24e07 100644 --- a/cpp/test/IcePack/simple/TestI.h +++ b/cpp/test/IcePack/simple/TestI.h @@ -1,29 +1,29 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_I_H
-#define TEST_I_H
-
-#include <Test.h>
-
-class TestI : public Test
-{
-public:
-
- TestI(const Ice::ObjectAdapterPtr&);
-
- virtual void shutdown(const Ice::Current&);
-
-private:
-
- Ice::ObjectAdapterPtr _adapter;
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class TestI : public Test +{ +public: + + TestI(const Ice::ObjectAdapterPtr&); + + virtual void shutdown(const Ice::Current&); + +private: + + Ice::ObjectAdapterPtr _adapter; +}; + +#endif diff --git a/cpp/test/IceUtil/thread/CreateTest.h b/cpp/test/IceUtil/thread/CreateTest.h index 4418f22dfef..48fb2ff64a0 100644 --- a/cpp/test/IceUtil/thread/CreateTest.h +++ b/cpp/test/IceUtil/thread/CreateTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef CREATE_TEST_H
-#define CREATE_TEST_H
-
-#include <TestBase.h>
-
-class CreateTest : public TestBase
-{
-public:
-
- CreateTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef CREATE_TEST_H +#define CREATE_TEST_H + +#include <TestBase.h> + +class CreateTest : public TestBase +{ +public: + + CreateTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/MonitorMutexTest.h b/cpp/test/IceUtil/thread/MonitorMutexTest.h index 108d72c7d22..93e3a828de0 100644 --- a/cpp/test/IceUtil/thread/MonitorMutexTest.h +++ b/cpp/test/IceUtil/thread/MonitorMutexTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef MONITOR_MUTEX_TEST_H
-#define MONITOR_MUTEX_TEST_H
-
-#include <TestBase.h>
-
-class MonitorMutexTest : public TestBase
-{
-public:
-
- MonitorMutexTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef MONITOR_MUTEX_TEST_H +#define MONITOR_MUTEX_TEST_H + +#include <TestBase.h> + +class MonitorMutexTest : public TestBase +{ +public: + + MonitorMutexTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/MonitorRecMutexTest.h b/cpp/test/IceUtil/thread/MonitorRecMutexTest.h index 9630deed340..979267efd0a 100644 --- a/cpp/test/IceUtil/thread/MonitorRecMutexTest.h +++ b/cpp/test/IceUtil/thread/MonitorRecMutexTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef MONITOR_REC_MUTEX_TEST_H
-#define MONITOR_REC_MUTEX_TEST_H
-
-#include <TestBase.h>
-
-class MonitorRecMutexTest : public TestBase
-{
-public:
-
- MonitorRecMutexTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef MONITOR_REC_MUTEX_TEST_H +#define MONITOR_REC_MUTEX_TEST_H + +#include <TestBase.h> + +class MonitorRecMutexTest : public TestBase +{ +public: + + MonitorRecMutexTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/MutexTest.h b/cpp/test/IceUtil/thread/MutexTest.h index d21a8a5e27b..cd688a3358a 100644 --- a/cpp/test/IceUtil/thread/MutexTest.h +++ b/cpp/test/IceUtil/thread/MutexTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef MUTEX_TEST_H
-#define MUTEX_TEST_H
-
-#include <TestBase.h>
-
-class MutexTest : public TestBase
-{
-public:
-
- MutexTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef MUTEX_TEST_H +#define MUTEX_TEST_H + +#include <TestBase.h> + +class MutexTest : public TestBase +{ +public: + + MutexTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/RWRecMutexTest.h b/cpp/test/IceUtil/thread/RWRecMutexTest.h index 3ca84c1631e..cc929b595c1 100644 --- a/cpp/test/IceUtil/thread/RWRecMutexTest.h +++ b/cpp/test/IceUtil/thread/RWRecMutexTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef RW_REC_MUTEX_TEST_H
-#define RE_REC_MUTEX_TEST_H
-
-#include <TestBase.h>
-
-class RWRecMutexTest : public TestBase
-{
-public:
-
- RWRecMutexTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef RW_REC_MUTEX_TEST_H +#define RE_REC_MUTEX_TEST_H + +#include <TestBase.h> + +class RWRecMutexTest : public TestBase +{ +public: + + RWRecMutexTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/RecMutexTest.h b/cpp/test/IceUtil/thread/RecMutexTest.h index 8b7476ca14b..b2d8a215f2a 100644 --- a/cpp/test/IceUtil/thread/RecMutexTest.h +++ b/cpp/test/IceUtil/thread/RecMutexTest.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef REC_MUTEX_TEST_H
-#define REC_MUTEX_TEST_H
-
-#include <TestBase.h>
-
-class RecMutexTest : public TestBase
-{
-public:
-
- RecMutexTest();
-
-private:
-
- virtual void run();
-};
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef REC_MUTEX_TEST_H +#define REC_MUTEX_TEST_H + +#include <TestBase.h> + +class RecMutexTest : public TestBase +{ +public: + + RecMutexTest(); + +private: + + virtual void run(); +}; + +#endif diff --git a/cpp/test/IceUtil/thread/TestBase.h b/cpp/test/IceUtil/thread/TestBase.h index 2b381289c43..b1943fdd056 100644 --- a/cpp/test/IceUtil/thread/TestBase.h +++ b/cpp/test/IceUtil/thread/TestBase.h @@ -1,44 +1,44 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_BASE_H
-#define TEST_BASE_H
-
-#include <IceUtil/Shared.h>
-#include <IceUtil/Handle.h>
-
-class TestFailed
-{
-public:
-
- TestFailed(const std::string&);
-
- const std::string name;
-};
-
-class TestBase : public IceUtil::Shared
-{
-public:
-
- TestBase(const std::string&);
-
- std::string name() const;
- void start();
-
-protected:
-
- virtual void run() = 0;
-
- const std::string _name;
-};
-
-typedef IceUtil::Handle<TestBase> TestBasePtr;
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_BASE_H +#define TEST_BASE_H + +#include <IceUtil/Shared.h> +#include <IceUtil/Handle.h> + +class TestFailed +{ +public: + + TestFailed(const std::string&); + + const std::string name; +}; + +class TestBase : public IceUtil::Shared +{ +public: + + TestBase(const std::string&); + + std::string name() const; + void start(); + +protected: + + virtual void run() = 0; + + const std::string _name; +}; + +typedef IceUtil::Handle<TestBase> TestBasePtr; + +#endif diff --git a/cpp/test/IceUtil/thread/TestSuite.h b/cpp/test/IceUtil/thread/TestSuite.h index db3e08318e7..81ca06d9f8f 100644 --- a/cpp/test/IceUtil/thread/TestSuite.h +++ b/cpp/test/IceUtil/thread/TestSuite.h @@ -1,22 +1,22 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_SUITE_H
-#define TEST_SUITE_H
-
-#include <TestBase.h>
-#include <list>
-
-extern std::list<TestBasePtr> allTests;
-
-void initializeTestSuite();
-
-#endif
-
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_SUITE_H +#define TEST_SUITE_H + +#include <TestBase.h> +#include <list> + +extern std::list<TestBasePtr> allTests; + +void initializeTestSuite(); + +#endif + diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h index 7a6e725559a..745aee68fde 100644 --- a/cpp/test/include/TestCommon.h +++ b/cpp/test/include/TestCommon.h @@ -1,27 +1,27 @@ -// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#ifndef TEST_COMMON_H
-#define TEST_COMMON_H
-
-#include <IceUtil/Config.h>
-#include <cstdlib>
-
-void
-inline testFailed(const char* expr, const char* file, unsigned int line)
-{
- std::cout << "failed!" << std::endl;
- std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl;
- abort();
-}
-
-#define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__))
-
-#endif
+// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef TEST_COMMON_H +#define TEST_COMMON_H + +#include <IceUtil/Config.h> +#include <cstdlib> + +void +inline testFailed(const char* expr, const char* file, unsigned int line) +{ + std::cout << "failed!" << std::endl; + std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl; + abort(); +} + +#define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__)) + +#endif |