diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/include | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'cpp/include')
42 files changed, 1660 insertions, 1660 deletions
diff --git a/cpp/include/Freeze/Initialize.h b/cpp/include/Freeze/Initialize.h index de656d2be30..87684264415 100644 --- a/cpp/include/Freeze/Initialize.h +++ b/cpp/include/Freeze/Initialize.h @@ -26,27 +26,27 @@ namespace Freeze { FREEZE_API EvictorPtr createEvictor(const Ice::ObjectAdapterPtr& adapter, - const std::string& envName, - const std::string& filename, - const ServantInitializerPtr& initializer = 0, - const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(), - bool createDb = true); + const std::string& envName, + const std::string& filename, + const ServantInitializerPtr& initializer = 0, + const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(), + bool createDb = true); FREEZE_API EvictorPtr createEvictor(const Ice::ObjectAdapterPtr& adapter, - const std::string& envName, - DbEnv& dbEnv, - const std::string& filename, - const ServantInitializerPtr& initializer = 0, - const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(), - bool createDb = true); + const std::string& envName, + DbEnv& dbEnv, + const std::string& filename, + const ServantInitializerPtr& initializer = 0, + const std::vector<Freeze::IndexPtr>& indices = std::vector<Freeze::IndexPtr>(), + bool createDb = true); FREEZE_API ConnectionPtr createConnection(const Ice::CommunicatorPtr& communicator, - const std::string& envName); + const std::string& envName); FREEZE_API ConnectionPtr createConnection(const Ice::CommunicatorPtr& communicator, - const std::string& envName, - DbEnv& dbEnv); + const std::string& envName, + DbEnv& dbEnv); FREEZE_API const std::string& catalogName(); diff --git a/cpp/include/Freeze/Map.h b/cpp/include/Freeze/Map.h index 2f26699caec..1c7e61c2add 100644 --- a/cpp/include/Freeze/Map.h +++ b/cpp/include/Freeze/Map.h @@ -89,12 +89,12 @@ public: static MapHelper* create(const Freeze::ConnectionPtr& connection, - const std::string& dbName, - const std::string& key, - const std::string& value, - const KeyCompareBasePtr&, - const std::vector<MapIndexBasePtr>&, - bool createDb); + const std::string& dbName, + const std::string& key, + const std::string& value, + const KeyCompareBasePtr&, + const std::vector<MapIndexBasePtr>&, + bool createDb); virtual ~MapHelper() = 0; @@ -167,10 +167,10 @@ public: // Forward declaration // template <typename key_type, typename mapped_type, - typename KeyCodec, typename ValueCodec, typename Compare> + typename KeyCodec, typename ValueCodec, typename Compare> class Map; template <typename key_type, typename mapped_type, - typename KeyCodec, typename ValueCodec, typename Compare> + typename KeyCodec, typename ValueCodec, typename Compare> class ConstIterator; // @@ -193,7 +193,7 @@ struct IteratorBase // necessary. // template<typename key_type, typename mapped_type, - typename KeyCodec, typename ValueCodec, typename Compare> + typename KeyCodec, typename ValueCodec, typename Compare> class Iterator : public IteratorBase { public: @@ -207,16 +207,16 @@ public: typedef value_type& reference; Iterator(MapHelper& mapHelper, const Ice::CommunicatorPtr& communicator) : - _helper(IteratorHelper::create(mapHelper, false)), - _communicator(communicator), - _refValid(false) + _helper(IteratorHelper::create(mapHelper, false)), + _communicator(communicator), + _refValid(false) { } Iterator(IteratorHelper* helper, const Ice::CommunicatorPtr& communicator) : - _helper(helper), - _communicator(communicator), - _refValid(false) + _helper(helper), + _communicator(communicator), + _refValid(false) { } @@ -226,32 +226,32 @@ public: } Iterator(const Iterator& rhs) : - _communicator(rhs._communicator), + _communicator(rhs._communicator), _refValid(false) { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } } Iterator& operator=(const Iterator& rhs) { - if(this != &rhs) - { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } - else - { - _helper.reset(); - } - _communicator = rhs._communicator; - _refValid = false; - } + if(this != &rhs) + { + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } + else + { + _helper.reset(); + } + _communicator = rhs._communicator; + _refValid = false; + } - return *this; + return *this; } ~Iterator() @@ -260,40 +260,40 @@ public: bool operator==(const Iterator& rhs) const { - if(_helper.get() == rhs._helper.get()) - { - return true; - } - - if(_helper.get() != 0 && rhs._helper.get() != 0) - { - const Key* lhsKey = _helper->get(); - const Key* rhsKey = rhs._helper->get(); - - if(lhsKey != 0 && rhsKey != 0) - { - return *lhsKey == *rhsKey; - } - } - return false; + if(_helper.get() == rhs._helper.get()) + { + return true; + } + + if(_helper.get() != 0 && rhs._helper.get() != 0) + { + const Key* lhsKey = _helper->get(); + const Key* rhsKey = rhs._helper->get(); + + if(lhsKey != 0 && rhsKey != 0) + { + return *lhsKey == *rhsKey; + } + } + return false; } bool operator!=(const Iterator& rhs) const { - return !(*this == rhs); + return !(*this == rhs); } Iterator& operator++() { - incr(); - return *this; + incr(); + return *this; } Iterator operator++(int) { - Iterator tmp = *this; - incr(); - return tmp; + Iterator tmp = *this; + incr(); + return tmp; } // @@ -321,7 +321,7 @@ public: _refValid = true; } - return _ref; + return _ref; } value_type* operator->() { return &(operator*()); } @@ -331,11 +331,11 @@ public: // void set(const mapped_type& value) { - assert(_helper.get()); + assert(_helper.get()); - Value v; - ValueCodec::write(value, v, _communicator); - _helper->set(v); + Value v; + ValueCodec::write(value, v, _communicator); + _helper->set(v); _refValid = false; } @@ -343,36 +343,36 @@ private: void incr() { - assert(_helper.get() != 0); - if(!_helper->next()) - { - // - // The iterator has been moved past the end, and is now - // invalid. - // - _helper.reset(); - } + assert(_helper.get() != 0); + if(!_helper->next()) + { + // + // The iterator has been moved past the end, and is now + // invalid. + // + _helper.reset(); + } _refValid = false; } void getCurrentValue(key_type& key, mapped_type& value) const { - assert(_helper.get() != 0); + assert(_helper.get() != 0); - const Key* k = 0; - const Value* v = 0; - _helper->get(k, v); - assert(k != 0); - assert(v != 0); + const Key* k = 0; + const Value* v = 0; + _helper->get(k, v); + assert(k != 0); + assert(v != 0); - KeyCodec::read(key, *k, _communicator); - ValueCodec::read(value, *v, _communicator); + KeyCodec::read(key, *k, _communicator); + ValueCodec::read(value, *v, _communicator); } friend class ConstIterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>; + KeyCodec, ValueCodec, Compare>; friend class Map<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>; + KeyCodec, ValueCodec, Compare>; std::auto_ptr<IteratorHelper> _helper; Ice::CommunicatorPtr _communicator; @@ -395,7 +395,7 @@ private: // See Iterator comments for design notes // template <typename key_type, typename mapped_type, - typename KeyCodec, typename ValueCodec, typename Compare> + typename KeyCodec, typename ValueCodec, typename Compare> class ConstIterator : public IteratorBase { public: @@ -409,16 +409,16 @@ public: typedef value_type& reference; ConstIterator(MapHelper& mapHelper, const Ice::CommunicatorPtr& communicator) : - _helper(IteratorHelper::create(mapHelper, true)), - _communicator(_communicator), - _refValid(false) + _helper(IteratorHelper::create(mapHelper, true)), + _communicator(_communicator), + _refValid(false) { } ConstIterator(IteratorHelper* helper, const Ice::CommunicatorPtr& communicator) : - _helper(helper), - _communicator(communicator), - _refValid(false) + _helper(helper), + _communicator(communicator), + _refValid(false) { } @@ -428,13 +428,13 @@ public: } ConstIterator(const ConstIterator& rhs) : - _communicator(rhs._communicator), + _communicator(rhs._communicator), _refValid(false) { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } } // @@ -442,53 +442,53 @@ public: // vice versa) - same for operator=. // ConstIterator(const Iterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>& rhs) : + KeyCodec, ValueCodec, Compare>& rhs) : _refValid(false) { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } - _communicator = rhs._communicator; + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } + _communicator = rhs._communicator; } ConstIterator& operator=(const ConstIterator& rhs) { - if(this != &rhs) - { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } - else - { - _helper.reset(); - } - _communicator = rhs._communicator; - _refValid = false; - } + if(this != &rhs) + { + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } + else + { + _helper.reset(); + } + _communicator = rhs._communicator; + _refValid = false; + } - return *this; + return *this; } // // Create const_iterator from iterator. // ConstIterator& operator=(const Iterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>& rhs) - { - if(rhs._helper.get() != 0) - { - _helper.reset(rhs._helper->clone()); - } - else - { - _helper.reset(); - } - _communicator = rhs._communicator; + KeyCodec, ValueCodec, Compare>& rhs) + { + if(rhs._helper.get() != 0) + { + _helper.reset(rhs._helper->clone()); + } + else + { + _helper.reset(); + } + _communicator = rhs._communicator; _refValid = false; - return *this; + return *this; } ~ConstIterator() @@ -497,40 +497,40 @@ public: bool operator==(const ConstIterator& rhs) { - if(_helper.get() == rhs._helper.get()) - { - return true; - } - - if(_helper.get() != 0 && rhs._helper.get() != 0) - { - const Key* lhsKey = _helper->get(); - const Key* rhsKey = rhs._helper->get(); - - if(lhsKey != 0 && rhsKey != 0) - { - return *lhsKey == *rhsKey; - } - } - return false; + if(_helper.get() == rhs._helper.get()) + { + return true; + } + + if(_helper.get() != 0 && rhs._helper.get() != 0) + { + const Key* lhsKey = _helper->get(); + const Key* rhsKey = rhs._helper->get(); + + if(lhsKey != 0 && rhsKey != 0) + { + return *lhsKey == *rhsKey; + } + } + return false; } bool operator!=(const ConstIterator& rhs) { - return !(*this == rhs); + return !(*this == rhs); } ConstIterator& operator++() { - incr(); - return *this; + incr(); + return *this; } ConstIterator operator++(int) { - ConstIterator tmp = *this; - incr(); - return tmp; + ConstIterator tmp = *this; + incr(); + return tmp; } // @@ -558,7 +558,7 @@ public: _refValid = true; } - return _ref; + return _ref; } pointer operator->() const { return &(operator*()); } @@ -567,34 +567,34 @@ private: void incr() { - assert(_helper.get() != 0); - if(!_helper->next()) - { - // - // The iterator has been moved past the end, and is now - // invalid. - // - _helper.reset(); - } + assert(_helper.get() != 0); + if(!_helper->next()) + { + // + // The iterator has been moved past the end, and is now + // invalid. + // + _helper.reset(); + } _refValid = false; } void getCurrentValue(key_type& key, mapped_type& value) const { - assert(_helper.get() != 0); + assert(_helper.get() != 0); - const Key* k = 0; - const Value* v = 0; - _helper->get(k, v); - assert(k != 0); - assert(v != 0); + const Key* k = 0; + const Value* v = 0; + _helper->get(k, v); + assert(k != 0); + assert(v != 0); - KeyCodec::read(key, *k, _communicator); - ValueCodec::read(value, *v, _communicator); + KeyCodec::read(key, *k, _communicator); + ValueCodec::read(value, *v, _communicator); } friend class Map<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>; + KeyCodec, ValueCodec, Compare>; std::auto_ptr<IteratorHelper> _helper; Ice::CommunicatorPtr _communicator; @@ -622,7 +622,7 @@ struct IceEncodingCompare { bool operator()(...) { - return false; + return false; } }; @@ -648,35 +648,35 @@ class KeyCompare : public KeyCompareBase { public: KeyCompare(const Compare& compare, - const Ice::CommunicatorPtr& communicator) : + const Ice::CommunicatorPtr& communicator) : #if defined(_MSC_VER) && (_MSC_VER <= 1300) - KeyCompareBase(enableKeyCompare(compare)), + KeyCompareBase(enableKeyCompare(compare)), #else - KeyCompareBase(true), + KeyCompareBase(true), #endif - _compare(compare), - _communicator(communicator) + _compare(compare), + _communicator(communicator) {} virtual int compare(const Key& dbKey1, const Key& dbKey2) { - key_type key1; - KeyCodec::read(key1, dbKey1, _communicator); - key_type key2; - KeyCodec::read(key2, dbKey2, _communicator); - - if(_compare(key1, key2)) - { - return -1; - } - else if(_compare(key2, key1)) - { - return 1; - } - else - { - return 0; - } + key_type key1; + KeyCodec::read(key1, dbKey1, _communicator); + key_type key2; + KeyCodec::read(key2, dbKey2, _communicator); + + if(_compare(key1, key2)) + { + return -1; + } + else if(_compare(key2, key1)) + { + return 1; + } + else + { + return 0; + } } private: Compare _compare; @@ -693,13 +693,13 @@ class KeyCompare<key_type, KeyCodec, IceEncodingCompare> : public KeyCompareBase { public: KeyCompare(const IceEncodingCompare&, const Ice::CommunicatorPtr&): - KeyCompareBase(false) + KeyCompareBase(false) {} virtual int compare(const Key& dbKey1, const Key& dbKey2) { - assert(0); - return 0; + assert(0); + return 0; } }; #endif @@ -714,33 +714,33 @@ class MapIndex : public MapIndexBase public: virtual int compare(const Key& dbKey1, const Key& dbKey2) { - key_type key1; - KeyCodec::read(key1, dbKey1, _communicator); - key_type key2; - KeyCodec::read(key2, dbKey2, _communicator); - - if(_compare(key1, key2)) - { - return -1; - } - else if(_compare(key2, key1)) - { - return 1; - } - else - { - return 0; - } + key_type key1; + KeyCodec::read(key1, dbKey1, _communicator); + key_type key2; + KeyCodec::read(key2, dbKey2, _communicator); + + if(_compare(key1, key2)) + { + return -1; + } + else if(_compare(key2, key1)) + { + return 1; + } + else + { + return 0; + } } protected: MapIndex(const std::string& name, const Compare& compare) : #if defined(_MSC_VER) && (_MSC_VER <= 1300) - MapIndexBase(name, enableKeyCompare(compare)), + MapIndexBase(name, enableKeyCompare(compare)), #else - MapIndexBase(name, true), + MapIndexBase(name, true), #endif - _compare(compare) + _compare(compare) {} private: @@ -758,13 +758,13 @@ class MapIndex<key_type, KeyCodec, IceEncodingCompare> : public MapIndexBase public: virtual int compare(const Key& dbKey1, const Key& dbKey2) { - assert(0); - return 0; + assert(0); + return 0; } protected: MapIndex(const std::string& name, const IceEncodingCompare&): - MapIndexBase(name, false) + MapIndexBase(name, false) {} }; #endif @@ -777,8 +777,8 @@ protected: // TODO: implement bidirectional iterators. // template<typename key_type, typename mapped_type, - typename KeyCodec, typename ValueCodec, - typename Compare = IceEncodingCompare> + typename KeyCodec, typename ValueCodec, + typename Compare = IceEncodingCompare> class Map { public: @@ -786,9 +786,9 @@ public: typedef std::pair<const key_type, const mapped_type> value_type; typedef Iterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare> iterator; + KeyCodec, ValueCodec, Compare> iterator; typedef ConstIterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare> const_iterator; + KeyCodec, ValueCodec, Compare> const_iterator; // // No definition for reference, const_reference, pointer or @@ -807,41 +807,41 @@ public: // Constructors // Map(const Freeze::ConnectionPtr& connection, - const std::string& dbName, - bool createDb = true, - const Compare& compare = Compare()) : - _communicator(connection->getCommunicator()) - { - KeyCompareBasePtr keyCompare = - new KeyCompare<key_type, KeyCodec, Compare>(compare, _communicator); - std::vector<MapIndexBasePtr> indices; + const std::string& dbName, + bool createDb = true, + const Compare& compare = Compare()) : + _communicator(connection->getCommunicator()) + { + KeyCompareBasePtr keyCompare = + new KeyCompare<key_type, KeyCodec, Compare>(compare, _communicator); + std::vector<MapIndexBasePtr> indices; - _helper.reset(MapHelper::create(connection, dbName, - KeyCodec::typeId(), ValueCodec::typeId(), - keyCompare, indices, createDb)); + _helper.reset(MapHelper::create(connection, dbName, + KeyCodec::typeId(), ValueCodec::typeId(), + keyCompare, indices, createDb)); } template<class _InputIterator> Map(const Freeze::ConnectionPtr& connection, - const std::string& dbName, - bool createDb, - _InputIterator first, _InputIterator last, - const Compare& compare = Compare()) : - _communicator(connection->getCommunicator()) + const std::string& dbName, + bool createDb, + _InputIterator first, _InputIterator last, + const Compare& compare = Compare()) : + _communicator(connection->getCommunicator()) { - KeyCompareBasePtr keyCompare = - new KeyCompare<key_type, KeyCodec, Compare>(compare, _communicator); + KeyCompareBasePtr keyCompare = + new KeyCompare<key_type, KeyCodec, Compare>(compare, _communicator); - std::vector<MapIndexBasePtr> indices; + std::vector<MapIndexBasePtr> indices; - _helper.reset(MapHelper::create(connection, dbName, - KeyCodec::typeId(), ValueCodec::typeId(), - keyCompare, indices, createDb)); - while(first != last) - { - put(*first); - ++first; - } + _helper.reset(MapHelper::create(connection, dbName, + KeyCodec::typeId(), ValueCodec::typeId(), + keyCompare, indices, createDb)); + while(first != last) + { + put(*first); + ++first; + } } ~Map() @@ -850,94 +850,94 @@ public: bool operator==(const Map& 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; + // + // 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 Map& rhs) const { - return !(*this == rhs); + return !(*this == rhs); } void swap(Map& rhs) { - MapHelper* tmp = _helper.release(); - _helper.reset(rhs._helper.release()); - rhs._helper.reset(tmp); - - Ice::CommunicatorPtr tmpCom = _communicator; - _communicator = rhs._communicator; - rhs._communicator = tmpCom; + MapHelper* tmp = _helper.release(); + _helper.reset(rhs._helper.release()); + rhs._helper.reset(tmp); + + Ice::CommunicatorPtr tmpCom = _communicator; + _communicator = rhs._communicator; + rhs._communicator = tmpCom; } iterator begin() { - try - { - return iterator(IteratorHelper::create(*_helper.get(), false), _communicator); - } - catch(const NotFoundException&) - { - return iterator(); - } + try + { + return iterator(IteratorHelper::create(*_helper.get(), false), _communicator); + } + catch(const NotFoundException&) + { + return iterator(); + } } const_iterator begin() const { - try - { - return const_iterator(IteratorHelper::create(*_helper.get(), true), _communicator); - } - catch(const NotFoundException&) - { - return const_iterator(); - } + try + { + return const_iterator(IteratorHelper::create(*_helper.get(), true), _communicator); + } + catch(const NotFoundException&) + { + return const_iterator(); + } } iterator end() { - return iterator(); + return iterator(); } const_iterator end() const { - return const_iterator(); + return const_iterator(); } bool empty() const { - return size() == 0; + return size() == 0; } size_type size() const { - return _helper->size(); + return _helper->size(); } size_type max_size() const { - return 0xffffffff; // TODO: is this the max? + return 0xffffffff; // TODO: is this the max? } // @@ -962,106 +962,106 @@ public: iterator insert(iterator /*position*/, const value_type& key) { - // - // position is ignored. - // - Key k; - KeyCodec::write(key.first, k, _communicator); - - iterator r = iterator(_helper->find(k, false), _communicator); + // + // position is ignored. + // + Key k; + KeyCodec::write(key.first, k, _communicator); + + iterator r = iterator(_helper->find(k, false), _communicator); - if(r == end()) - { - Value v; - ValueCodec::write(key.second, v, _communicator); - - _helper->put(k, v); - r = iterator(_helper->find(k, false), _communicator); - } + if(r == end()) + { + Value v; + ValueCodec::write(key.second, v, _communicator); + + _helper->put(k, v); + r = iterator(_helper->find(k, false), _communicator); + } - return r; + return r; } std::pair<iterator, bool> insert(const value_type& key) { - Key k; - KeyCodec::write(key.first, k, _communicator); + Key k; + KeyCodec::write(key.first, k, _communicator); - iterator r = iterator(_helper->find(k, false), _communicator); - bool inserted = false; + iterator r = iterator(_helper->find(k, false), _communicator); + bool inserted = false; - if(r == end()) - { - Value v; - ValueCodec::write(key.second, v, _communicator); - - _helper->put(k, v); - inserted = true; - r = iterator(_helper->find(k, false), _communicator); - } + if(r == end()) + { + Value v; + ValueCodec::write(key.second, v, _communicator); + + _helper->put(k, v); + inserted = true; + r = iterator(_helper->find(k, false), _communicator); + } - return std::pair<iterator, bool>(r, inserted); + return std::pair<iterator, bool>(r, inserted); } template <typename InputIterator> void insert(InputIterator first, InputIterator last) { - while(first != last) - { - insert(*first); - ++first; - } + while(first != last) + { + insert(*first); + ++first; + } } void put(const value_type& key) { - // - // insert or replace - // - Key k; - Value v; - KeyCodec::write(key.first, k, _communicator); - ValueCodec::write(key.second, v, _communicator); + // + // insert or replace + // + Key k; + Value v; + KeyCodec::write(key.first, k, _communicator); + ValueCodec::write(key.second, v, _communicator); - _helper->put(k, v); + _helper->put(k, v); } template <typename InputIterator> void put(InputIterator first, InputIterator last) { - while(first != last) - { - put(*first); - ++first; - } + while(first != last) + { + put(*first); + ++first; + } } void erase(iterator position) { - assert(position._helper.get() != 0); - position._helper->erase(); + assert(position._helper.get() != 0); + position._helper->erase(); } size_type erase(const key_type& key) { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return _helper->erase(k); + return _helper->erase(k); } void erase(iterator first, iterator last) { - while(first != last) - { - first._helper->erase(); - ++first; - } + while(first != last) + { + first._helper->erase(); + ++first; + } } void clear() { - _helper->clear(); + _helper->clear(); } @@ -1070,87 +1070,87 @@ public: // void destroy() { - _helper->destroy(); + _helper->destroy(); } iterator find(const key_type& key) { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return iterator(_helper->find(k, false), _communicator); + return iterator(_helper->find(k, false), _communicator); } const_iterator find(const key_type& key) const { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return const_iterator(_helper->find(k, true), _communicator); + return const_iterator(_helper->find(k, true), _communicator); } size_type count(const key_type& key) const { - Key k; - KeyCodec::write(key, k, _communicator); - - return _helper->count(k); + Key k; + KeyCodec::write(key, k, _communicator); + + return _helper->count(k); } iterator lower_bound(const key_type& key) { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return iterator(_helper->lowerBound(k, false), _communicator); + return iterator(_helper->lowerBound(k, false), _communicator); } const_iterator lower_bound(const key_type& key) const { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return iterator(_helper->lowerBound(k, true), _communicator); + return iterator(_helper->lowerBound(k, true), _communicator); } iterator upper_bound(const key_type& key) { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return iterator(_helper->upperBound(k, false), _communicator); + return iterator(_helper->upperBound(k, false), _communicator); } const_iterator upper_bound(const key_type& key) const { - Key k; - KeyCodec::write(key, k, _communicator); + Key k; + KeyCodec::write(key, k, _communicator); - return iterator(_helper->upperBound(k, true), _communicator); + return iterator(_helper->upperBound(k, true), _communicator); } std::pair<iterator, iterator> equal_range(const key_type& key) { - return std::make_pair(lower_bound(key), upper_bound(key)); + return std::make_pair(lower_bound(key), upper_bound(key)); } std::pair<const_iterator, const_iterator> equal_range(const key_type& key) const { - return std::make_pair(lower_bound(key), upper_bound(key)); + return std::make_pair(lower_bound(key), upper_bound(key)); } const Ice::CommunicatorPtr& communicator() const { - return _communicator(); + return _communicator(); } protected: Map(const Ice::CommunicatorPtr& communicator) : - _communicator(communicator) + _communicator(communicator) { } @@ -1170,19 +1170,19 @@ namespace std // TODO: update. template <class key_type, class mapped_type, - class KeyCodec, class ValueCodec, class Compare> + class KeyCodec, class ValueCodec, class Compare> inline pair<const key_type, const mapped_type>* value_type(const Freeze::Iterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>&) + KeyCodec, ValueCodec, Compare>&) { return (pair<const key_type, const mapped_type>*)0; } template <class key_type, class mapped_type, - class KeyCodec, class ValueCodec, class Compare> + class KeyCodec, class ValueCodec, class Compare> inline pair<const key_type, const mapped_type>* value_type(const Freeze::ConstIterator<key_type, mapped_type, - KeyCodec, ValueCodec, Compare>&) + KeyCodec, ValueCodec, Compare>&) { return (pair<const key_type, const mapped_type>*)0; } diff --git a/cpp/include/Ice/BasicStream.h b/cpp/include/Ice/BasicStream.h index 671c46f49d6..7cab7da51ef 100644 --- a/cpp/include/Ice/BasicStream.h +++ b/cpp/include/Ice/BasicStream.h @@ -38,14 +38,14 @@ public: public: StreamUTF8BufferI(BasicStream& stream) : - _stream(stream) - { - } + _stream(stream) + { + } Ice::Byte* getMoreBytes(size_t howMany, Ice::Byte* firstUnused) { - assert(howMany > 0); + assert(howMany > 0); if(firstUnused != 0) { @@ -71,7 +71,7 @@ public: private: - BasicStream& _stream; + BasicStream& _stream; }; typedef void (*PatchFunc)(void*, Ice::ObjectPtr&); @@ -102,14 +102,14 @@ public: void resize(Container::size_type sz) { // - // Check memory limit if stream is not unlimited. - // - if(!_unlimited && sz > _messageSizeMax) - { - throwMemoryLimitException(__FILE__, __LINE__); - } - - b.resize(sz); + // Check memory limit if stream is not unlimited. + // + if(!_unlimited && sz > _messageSizeMax) + { + throwMemoryLimitException(__FILE__, __LINE__); + } + + b.resize(sz); } void startSeq(int, int); @@ -142,8 +142,8 @@ public: void checkFixedSeq(int, int); // For sequences of fixed-size types. void endElement() { - assert(_seqDataStack); - --_seqDataStack->numElements; + assert(_seqDataStack); + --_seqDataStack->numElements; } void endSeq(int); @@ -364,32 +364,32 @@ public: void write(Ice::Byte v) { - b.push_back(v); + b.push_back(v); } void write(const Ice::Byte*, const Ice::Byte*); void read(Ice::Byte& v) { - if(i >= b.end()) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - v = *i++; + if(i >= b.end()) + { + throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); + } + v = *i++; } void read(std::pair<const Ice::Byte*, const Ice::Byte*>&); void write(bool v) { - b.push_back(static_cast<Ice::Byte>(v)); + b.push_back(static_cast<Ice::Byte>(v)); } void write(const std::vector<bool>&); void write(const bool*, const bool*); void read(bool& v) { - if(i >= b.end()) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - v = *i++; + if(i >= b.end()) + { + throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); + } + v = *i++; } void read(std::vector<bool>&); bool* read(std::pair<const bool*, const bool*>&); @@ -479,11 +479,11 @@ public: { Ice::Int sz = static_cast<Ice::Int>(v.size()); if(convert && sz > 0 && _stringConverter != 0) - { - writeConverted(v); - } - else - { + { + writeConverted(v); + } + else + { writeSize(sz); if(sz > 0) { @@ -491,7 +491,7 @@ public: resize(pos + sz); memcpy(&b[pos], v.data(), sz); } - } + } } void write(const std::string*, const std::string*, bool = true); void read(std::string& v, bool convert = true) @@ -505,14 +505,14 @@ public: { throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); } - if(convert && _stringConverter != 0) - { - _stringConverter->fromUTF8(i, i + sz, v); - } - else - { + if(convert && _stringConverter != 0) + { + _stringConverter->fromUTF8(i, i + sz, v); + } + else + { std::string(reinterpret_cast<const char*>(&*i), reinterpret_cast<const char*>(&*i) + sz).swap(v); - } + } i += sz; } else @@ -535,7 +535,7 @@ public: throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); } - _wstringConverter->fromUTF8(i, i + sz, v); + _wstringConverter->fromUTF8(i, i + sz, v); i += sz; } else @@ -561,8 +561,8 @@ public: struct PatchEntry { - PatchFunc patchFunc; - void* patchAddr; + PatchFunc patchFunc; + void* patchAddr; }; typedef std::vector<PatchEntry> PatchList; @@ -598,20 +598,20 @@ private: { public: - ReadEncaps() : patchMap(0), unmarshaledMap(0), typeIdMap(0), typeIdIndex(0), previous(0) - { - // Inlined for performance reasons. - } - ~ReadEncaps() - { - // Inlined for performance reasons. + ReadEncaps() : patchMap(0), unmarshaledMap(0), typeIdMap(0), typeIdIndex(0), previous(0) + { + // Inlined for performance reasons. + } + ~ReadEncaps() + { + // Inlined for performance reasons. delete patchMap; delete unmarshaledMap; delete typeIdMap; - } - void reset() + } + void reset() { - // Inlined for performance reasons. + // Inlined for performance reasons. delete patchMap; delete unmarshaledMap; delete typeIdMap; @@ -622,40 +622,40 @@ private: typeIdIndex = 0; previous = 0; } - void swap(ReadEncaps&); + void swap(ReadEncaps&); - Container::size_type start; - Ice::Int sz; + Container::size_type start; + Ice::Int sz; - Ice::Byte encodingMajor; - Ice::Byte encodingMinor; + Ice::Byte encodingMajor; + Ice::Byte encodingMinor; - PatchMap* patchMap; - IndexToPtrMap* unmarshaledMap; - TypeIdReadMap* typeIdMap; - Ice::Int typeIdIndex; + PatchMap* patchMap; + IndexToPtrMap* unmarshaledMap; + TypeIdReadMap* typeIdMap; + Ice::Int typeIdIndex; - ReadEncaps* previous; + ReadEncaps* previous; }; class ICE_API WriteEncaps : private ::IceUtil::noncopyable { public: - WriteEncaps() : writeIndex(0), toBeMarshaledMap(0), marshaledMap(0), typeIdMap(0), typeIdIndex(0), previous(0) - { - // Inlined for performance reasons. - } - ~WriteEncaps() + WriteEncaps() : writeIndex(0), toBeMarshaledMap(0), marshaledMap(0), typeIdMap(0), typeIdIndex(0), previous(0) + { + // Inlined for performance reasons. + } + ~WriteEncaps() { - // Inlined for performance reasons. + // Inlined for performance reasons. delete toBeMarshaledMap; delete marshaledMap; delete typeIdMap; } - void reset() + void reset() { - // Inlined for performance reasons. + // Inlined for performance reasons. delete toBeMarshaledMap; delete marshaledMap; delete typeIdMap; @@ -667,17 +667,17 @@ private: typeIdIndex = 0; previous = 0; } - void swap(WriteEncaps&); + void swap(WriteEncaps&); - Container::size_type start; + Container::size_type start; - Ice::Int writeIndex; - PtrToIndexMap* toBeMarshaledMap; - PtrToIndexMap* marshaledMap; - TypeIdWriteMap* typeIdMap; - Ice::Int typeIdIndex; + Ice::Int writeIndex; + PtrToIndexMap* toBeMarshaledMap; + PtrToIndexMap* marshaledMap; + TypeIdWriteMap* typeIdMap; + Ice::Int typeIdIndex; - WriteEncaps* previous; + WriteEncaps* previous; }; ReadEncaps* _currentReadEncaps; @@ -705,10 +705,10 @@ private: struct SeqData { - SeqData(int, int); - int numElements; - int minSize; - SeqData* previous; + SeqData(int, int); + int numElements; + int minSize; + SeqData* previous; }; SeqData* _seqDataStack; diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h index a15b9184b53..b780d84d2fa 100644 --- a/cpp/include/Ice/Buffer.h +++ b/cpp/include/Ice/Buffer.h @@ -28,122 +28,122 @@ public: { public: - // - // Standard vector-like operations. - // - - typedef Ice::Byte value_type; - typedef Ice::Byte* iterator; - typedef const Ice::Byte* const_iterator; - typedef Ice::Byte& reference; - typedef const Ice::Byte& const_reference; - typedef Ice::Byte* pointer; - typedef ptrdiff_t difference_type; - typedef size_t size_type; - - Container(size_type maxCapacity); - - ~Container(); - - iterator begin() - { - return _buf; - } - - const_iterator begin() const - { - return _buf; - } - - iterator end() - { - return _buf + _size; - } - - const_iterator end() const - { - return _buf + _size; - } - - size_type size() const - { - return _size; - } - - bool empty() const - { - return !_size; - } - - void swap(Container&); - - void clear(); - - void resize(size_type n) // Inlined for performance reasons. + // + // Standard vector-like operations. + // + + typedef Ice::Byte value_type; + typedef Ice::Byte* iterator; + typedef const Ice::Byte* const_iterator; + typedef Ice::Byte& reference; + typedef const Ice::Byte& const_reference; + typedef Ice::Byte* pointer; + typedef ptrdiff_t difference_type; + typedef size_t size_type; + + Container(size_type maxCapacity); + + ~Container(); + + iterator begin() + { + return _buf; + } + + const_iterator begin() const + { + return _buf; + } + + iterator end() + { + return _buf + _size; + } + + const_iterator end() const + { + return _buf + _size; + } + + size_type size() const + { + return _size; + } + + bool empty() const + { + return !_size; + } + + void swap(Container&); + + void clear(); + + void resize(size_type n) // Inlined for performance reasons. + { + if(n == 0) + { + clear(); + } + else if(n > _capacity) + { + reserve(n); + } + _size = n; + } + + void reset() + { + if(_size > 0 && _size * 2 < _capacity) + { + // + // If the current buffer size is smaller than the + // buffer capacity, we shrink the buffer memory to the + // current size. This is to avoid holding on too much + // memory if it's not needed anymore. + // + if(++_shrinkCounter > 2) + { + reserve(_size); + _shrinkCounter = 0; + } + } + else + { + _shrinkCounter = 0; + } + _size = 0; + } + + void push_back(value_type v) + { + resize(_size + 1); + _buf[_size - 1] = v; + } + + reference operator[](size_type n) + { + assert(n < _size); + return _buf[n]; + } + + const_reference operator[](size_type n) const { - if(n == 0) - { - clear(); - } - else if(n > _capacity) - { - reserve(n); - } - _size = n; - } - - void reset() - { - if(_size > 0 && _size * 2 < _capacity) - { - // - // If the current buffer size is smaller than the - // buffer capacity, we shrink the buffer memory to the - // current size. This is to avoid holding on too much - // memory if it's not needed anymore. - // - if(++_shrinkCounter > 2) - { - reserve(_size); - _shrinkCounter = 0; - } - } - else - { - _shrinkCounter = 0; - } - _size = 0; - } - - void push_back(value_type v) - { - resize(_size + 1); - _buf[_size - 1] = v; - } - - reference operator[](size_type n) - { - assert(n < _size); - return _buf[n]; - } - - const_reference operator[](size_type n) const - { - assert(n < _size); - return _buf[n]; - } - + assert(n < _size); + return _buf[n]; + } + private: - Container(const Container&); - void operator=(const Container&); - void reserve(size_type); + Container(const Container&); + void operator=(const Container&); + void reserve(size_type); - pointer _buf; - size_type _size; - size_type _capacity; - size_type _maxCapacity; - int _shrinkCounter; + pointer _buf; + size_type _size; + size_type _capacity; + size_type _maxCapacity; + int _shrinkCounter; }; Container b; diff --git a/cpp/include/Ice/FactoryTable.h b/cpp/include/Ice/FactoryTable.h index 81e15a485c0..8a534ab252d 100644 --- a/cpp/include/Ice/FactoryTable.h +++ b/cpp/include/Ice/FactoryTable.h @@ -23,7 +23,7 @@ public: ~FactoryTable(); }; -static FactoryTable factoryTableInitializer; // Dummy variable to force initialization of factoryTable +static FactoryTable factoryTableInitializer; // Dummy variable to force initialization of factoryTable extern ICE_API FactoryTableDef* factoryTable; diff --git a/cpp/include/Ice/GCShared.h b/cpp/include/Ice/GCShared.h index 2812a1b4702..df5dd94262e 100755 --- a/cpp/include/Ice/GCShared.h +++ b/cpp/include/Ice/GCShared.h @@ -44,12 +44,12 @@ public: int __getRefUnsafe() const { - return _ref; + return _ref; } void __decRefUnsafe() { - --_ref; + --_ref; } protected: diff --git a/cpp/include/Ice/Handle.h b/cpp/include/Ice/Handle.h index 0fc6212cb93..c224ceace4e 100644 --- a/cpp/include/Ice/Handle.h +++ b/cpp/include/Ice/Handle.h @@ -44,143 +44,143 @@ public: Handle(T* p = 0) { - this->_ptr = p; + this->_ptr = p; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } template<typename Y> Handle(const Handle<Y>& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } template<typename Y> Handle(const ::IceUtil::Handle<Y>& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } Handle(const Handle& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } ~Handle() { - if(this->_ptr) - { - decRef(this->_ptr); - } + if(this->_ptr) + { + decRef(this->_ptr); + } } Handle& operator=(T* p) { - if(this->_ptr != p) - { - if(p) - { - incRef(p); - } - - T* ptr = this->_ptr; - this->_ptr = p; - - if(ptr) - { - decRef(ptr); - } - } - return *this; + if(this->_ptr != p) + { + if(p) + { + incRef(p); + } + + T* ptr = this->_ptr; + this->_ptr = p; + + if(ptr) + { + decRef(ptr); + } + } + return *this; } template<typename Y> Handle& operator=(const Handle<Y>& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - T* ptr = this->_ptr; - this->_ptr = r._ptr; - - if(ptr) - { - decRef(ptr); - } - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + T* ptr = this->_ptr; + this->_ptr = r._ptr; + + if(ptr) + { + decRef(ptr); + } + } + return *this; } template<typename Y> Handle& operator=(const ::IceUtil::Handle<Y>& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - T* ptr = this->_ptr; - this->_ptr = r._ptr; - - if(ptr) - { - decRef(ptr); - } - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + T* ptr = this->_ptr; + this->_ptr = r._ptr; + + if(ptr) + { + decRef(ptr); + } + } + return *this; } Handle& operator=(const Handle& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - T* ptr = this->_ptr; - this->_ptr = r._ptr; - - if(ptr) - { - decRef(ptr); - } - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + T* ptr = this->_ptr; + this->_ptr = r._ptr; + + if(ptr) + { + decRef(ptr); + } + } + return *this; } template<class Y> static Handle dynamicCast(const ::IceUtil::HandleBase<Y>& r) { #ifdef __BCPLUSPLUS__ - return Handle<T>(dynamic_cast<T*>(r._ptr)); + return Handle<T>(dynamic_cast<T*>(r._ptr)); #else - return Handle(dynamic_cast<T*>(r._ptr)); + return Handle(dynamic_cast<T*>(r._ptr)); #endif } @@ -188,15 +188,15 @@ public: static Handle dynamicCast(Y* p) { #ifdef __BCPLUSPLUS__ - return Handle<T>(dynamic_cast<T*>(p)); + return Handle<T>(dynamic_cast<T*>(p)); #else - return Handle(dynamic_cast<T*>(p)); + return Handle(dynamic_cast<T*>(p)); #endif } void __clearHandleUnsafe() { - this->_ptr = 0; + this->_ptr = 0; } }; diff --git a/cpp/include/Ice/IncomingAsync.h b/cpp/include/Ice/IncomingAsync.h index dc6af5ed78a..e7c5ba20ece 100644 --- a/cpp/include/Ice/IncomingAsync.h +++ b/cpp/include/Ice/IncomingAsync.h @@ -99,7 +99,7 @@ public: }; class ICE_API AMD_Array_Object_ice_invoke : public ::Ice::AMD_Array_Object_ice_invoke, - public IceInternal::IncomingAsync + public IceInternal::IncomingAsync { public: diff --git a/cpp/include/Ice/Initialize.h b/cpp/include/Ice/Initialize.h index 78cd1dbd104..77c8df84026 100644 --- a/cpp/include/Ice/Initialize.h +++ b/cpp/include/Ice/Initialize.h @@ -65,22 +65,22 @@ struct InitializationData }; ICE_API CommunicatorPtr initialize(int&, char*[], const InitializationData& = InitializationData(), - Int = ICE_INT_VERSION); + Int = ICE_INT_VERSION); ICE_API CommunicatorPtr initialize(Ice::StringSeq&, const InitializationData& = InitializationData(), - Int = ICE_INT_VERSION); + Int = ICE_INT_VERSION); ICE_API CommunicatorPtr initialize(const InitializationData& = InitializationData(), - Int = ICE_INT_VERSION); + Int = ICE_INT_VERSION); ICE_API ICE_DEPRECATED_API CommunicatorPtr initializeWithProperties(int&, char*[], const PropertiesPtr&, - Int = ICE_INT_VERSION); + Int = ICE_INT_VERSION); ICE_API ICE_DEPRECATED_API CommunicatorPtr initializeWithLogger(int&, char*[], const Ice::LoggerPtr&, - Int = ICE_INT_VERSION); + Int = ICE_INT_VERSION); ICE_API ICE_DEPRECATED_API CommunicatorPtr initializeWithPropertiesAndLogger(int&, char*[], const PropertiesPtr&, - const Ice::LoggerPtr&, - Int = ICE_INT_VERSION); + const Ice::LoggerPtr&, + Int = ICE_INT_VERSION); ICE_API InputStreamPtr createInputStream(const CommunicatorPtr&, const ::std::vector< Byte >&); ICE_API OutputStreamPtr createOutputStream(const CommunicatorPtr&); diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h index e740d25a69d..2fe85ed8508 100644 --- a/cpp/include/Ice/Object.h +++ b/cpp/include/Ice/Object.h @@ -133,7 +133,7 @@ public: // Returns true if ok, false if user exception. virtual void ice_invoke_async(const AMD_Array_Object_ice_invokePtr&, const std::pair<const Byte*, const Byte*>&, - const Current&) = 0; + const Current&) = 0; virtual IceInternal::DispatchStatus __dispatch(IceInternal::Incoming&, const Current&); }; diff --git a/cpp/include/Ice/Outgoing.h b/cpp/include/Ice/Outgoing.h index 30e8f0c4d43..2ce534c3466 100644 --- a/cpp/include/Ice/Outgoing.h +++ b/cpp/include/Ice/Outgoing.h @@ -85,11 +85,11 @@ private: enum { - StateUnsent, - StateInProgress, - StateOK, - StateUserException, - StateLocalException + StateUnsent, + StateInProgress, + StateOK, + StateUserException, + StateLocalException } _state; BasicStream _is; diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index 768846e619c..21a3796b156 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -77,7 +77,7 @@ public: virtual void ice_exception(const Ice::Exception&) = 0; void __invoke(const Ice::ObjectPrx&, const std::string& operation, OperationMode, - const std::vector<Ice::Byte>&, const Context*); + const std::vector<Ice::Byte>&, const Context*); protected: @@ -92,7 +92,7 @@ public: virtual void ice_exception(const Ice::Exception&) = 0; void __invoke(const Ice::ObjectPrx&, const std::string& operation, OperationMode, - const std::pair<const Byte*, const Byte*>&, const Context*); + const std::pair<const Byte*, const Byte*>&, const Context*); protected: diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 3c7d1b3912a..9a70a3a65c0 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -93,82 +93,82 @@ public: bool ice_isA(const ::std::string& typeId) { - return ice_isA(typeId, 0); + return ice_isA(typeId, 0); } bool ice_isA(const ::std::string& typeId, const ::Ice::Context& context) { - return ice_isA(typeId, &context); + return ice_isA(typeId, &context); } void ice_ping() { - ice_ping(0); + ice_ping(0); } void ice_ping(const ::Ice::Context& context) { - ice_ping(&context); + ice_ping(&context); } ::std::vector< ::std::string> ice_ids() { - return ice_ids(0); + return ice_ids(0); } ::std::vector< ::std::string> ice_ids(const ::Ice::Context& context) { - return ice_ids(&context); + return ice_ids(&context); } ::std::string ice_id() { - return ice_id(0); + return ice_id(0); } ::std::string ice_id(const ::Ice::Context& context) { - return ice_id(&context); + return ice_id(&context); } // Returns true if ok, false if user exception. bool ice_invoke(const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::vector< ::Ice::Byte>& inParams, - ::std::vector< ::Ice::Byte>& outParams) + ::Ice::OperationMode mode, + const ::std::vector< ::Ice::Byte>& inParams, + ::std::vector< ::Ice::Byte>& outParams) { - const ::Ice::Context* context = 0; - return ice_invoke(operation, mode, inParams, outParams, context); + const ::Ice::Context* context = 0; + return ice_invoke(operation, mode, inParams, outParams, context); } bool ice_invoke(const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::vector< ::Ice::Byte>& inParams, - ::std::vector< ::Ice::Byte>& outParams, - const ::Ice::Context& context) + ::Ice::OperationMode mode, + const ::std::vector< ::Ice::Byte>& inParams, + ::std::vector< ::Ice::Byte>& outParams, + const ::Ice::Context& context) { - return ice_invoke(operation, mode, inParams, outParams, &context); + return ice_invoke(operation, mode, inParams, outParams, &context); } bool ice_invoke(const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, - ::std::vector< ::Ice::Byte>& outParams) + ::Ice::OperationMode mode, + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, + ::std::vector< ::Ice::Byte>& outParams) { - const ::Ice::Context* context = 0; - return ice_invoke(operation, mode, inParams, outParams, context); + const ::Ice::Context* context = 0; + return ice_invoke(operation, mode, inParams, outParams, context); } bool ice_invoke(const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, - ::std::vector< ::Ice::Byte>& outParams, - const ::Ice::Context& context) + ::Ice::OperationMode mode, + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, + ::std::vector< ::Ice::Byte>& outParams, + const ::Ice::Context& context) { - return ice_invoke(operation, mode, inParams, outParams, &context); + return ice_invoke(operation, mode, inParams, outParams, &context); } void ice_invoke_async(const ::Ice::AMI_Object_ice_invokePtr&, const ::std::string&, ::Ice::OperationMode, - const ::std::vector< ::Ice::Byte>&); + const ::std::vector< ::Ice::Byte>&); void ice_invoke_async(const ::Ice::AMI_Object_ice_invokePtr&, const ::std::string&, ::Ice::OperationMode, - const ::std::vector< ::Ice::Byte>&, const ::Ice::Context&); + const ::std::vector< ::Ice::Byte>&, const ::Ice::Context&); void ice_invoke_async(const ::Ice::AMI_Array_Object_ice_invokePtr&, const ::std::string&, ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&); + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&); void ice_invoke_async(const ::Ice::AMI_Array_Object_ice_invokePtr&, const ::std::string&, ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, const ::Ice::Context&); + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, const ::Ice::Context&); ::Ice::Identity ice_getIdentity() const; ICE_DEPRECATED_API ::Ice::ObjectPrx ice_newIdentity(const ::Ice::Identity&) const; @@ -241,11 +241,11 @@ public: ::IceInternal::ReferencePtr __reference() const; void __copyFrom(const ::Ice::ObjectPrx&); void __handleException(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, - const ::Ice::LocalException&, int&); + const ::Ice::LocalException&, int&); void __handleExceptionWrapper(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, - const ::IceInternal::LocalExceptionWrapper&); + const ::IceInternal::LocalExceptionWrapper&); void __handleExceptionWrapperRelaxed(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, - const ::IceInternal::LocalExceptionWrapper&, int&); + const ::IceInternal::LocalExceptionWrapper&, int&); void __checkTwowayOnly(const char*) const; void __checkTwowayOnly(const ::std::string&) const; @@ -265,15 +265,15 @@ private: bool ice_invoke(const ::std::string&, - ::Ice::OperationMode, - const ::std::vector< ::Ice::Byte>&, - ::std::vector< ::Ice::Byte>&, - const ::Ice::Context*); + ::Ice::OperationMode, + const ::std::vector< ::Ice::Byte>&, + ::std::vector< ::Ice::Byte>&, + const ::Ice::Context*); bool ice_invoke(const ::std::string&, - ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, - const ::Ice::Context*); + ::Ice::OperationMode, + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, + ::std::vector< ::Ice::Byte>&, + const ::Ice::Context*); void setup(const ::IceInternal::ReferencePtr&); friend class ::IceInternal::ProxyFactory; @@ -298,8 +298,8 @@ public: virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*) = 0; virtual ::std::string ice_id(const ::Ice::Context*) = 0; virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*) = 0; + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*) = 0; virtual ::Ice::ConnectionIPtr __getConnection(bool&) const = 0; }; @@ -320,8 +320,8 @@ public: virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*); virtual ::std::string ice_id(const ::Ice::Context*); virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); virtual ::Ice::ConnectionIPtr __getConnection(bool&) const; @@ -353,8 +353,8 @@ public: virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*); virtual ::std::string ice_id(const ::Ice::Context*); virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); + const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); virtual ::Ice::ConnectionIPtr __getConnection(bool&) const; @@ -388,7 +388,7 @@ struct ProxyIdentityLess : std::binary_function<bool, ObjectPrx&, ObjectPrx&> { bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const { - return proxyIdentityLess(lhs, rhs); + return proxyIdentityLess(lhs, rhs); } }; @@ -396,7 +396,7 @@ struct ProxyIdentityEqual : std::binary_function<bool, ObjectPrx&, ObjectPrx&> { bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const { - return proxyIdentityEqual(lhs, rhs); + return proxyIdentityEqual(lhs, rhs); } }; @@ -404,7 +404,7 @@ struct ProxyIdentityAndFacetLess : std::binary_function<bool, ObjectPrx&, Object { bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const { - return proxyIdentityAndFacetLess(lhs, rhs); + return proxyIdentityAndFacetLess(lhs, rhs); } }; @@ -412,7 +412,7 @@ struct ProxyIdentityAndFacetEqual : std::binary_function<bool, ObjectPrx&, Objec { bool operator()(const ObjectPrx& lhs, const ObjectPrx& rhs) const { - return proxyIdentityAndFacetEqual(lhs, rhs); + return proxyIdentityAndFacetEqual(lhs, rhs); } }; @@ -430,16 +430,16 @@ checkedCastImpl(const ::Ice::ObjectPrx& b, const ::Ice::Context* context) P d = 0; if(b.get()) { - typedef typename P::element_type T; - - d = dynamic_cast<T*>(b.get()); - if(!d && (context == 0 ? - b->ice_isA(T::ice_staticId()) : - b->ice_isA(T::ice_staticId(), *context))) - { - d = new T; - d->__copyFrom(b); - } + typedef typename P::element_type T; + + d = dynamic_cast<T*>(b.get()); + if(!d && (context == 0 ? + b->ice_isA(T::ice_staticId()) : + b->ice_isA(T::ice_staticId(), *context))) + { + d = new T; + d->__copyFrom(b); + } } return d; } @@ -450,14 +450,14 @@ uncheckedCastImpl(const ::Ice::ObjectPrx& b) P d = 0; if(b) { - typedef typename P::element_type T; - - d = dynamic_cast<T*>(b.get()); - if(!d) - { - d = new T; - d->__copyFrom(b); - } + typedef typename P::element_type T; + + d = dynamic_cast<T*>(b.get()); + if(!d) + { + d = new T; + d->__copyFrom(b); + } } return d; } @@ -489,7 +489,7 @@ uncheckedCastImpl< ::Ice::ObjectPrx>(const ::Ice::ObjectPrx& b, const std::strin ::Ice::ObjectPrx d = 0; if(b) { - d = b->ice_facet(f); + d = b->ice_facet(f); } return d; } @@ -504,8 +504,8 @@ checkedCastImpl(const ::Ice::ObjectPrx& b, const std::string& f, const ::Ice::Co if(bb) { - d = new T; - d->__copyFrom(bb); + d = new T; + d->__copyFrom(bb); } return d; } @@ -516,11 +516,11 @@ uncheckedCastImpl(const ::Ice::ObjectPrx& b, const std::string& f) P d = 0; if(b) { - typedef typename P::element_type T; + typedef typename P::element_type T; - ::Ice::ObjectPrx bb = b->ice_facet(f); - d = new T; - d->__copyFrom(bb); + ::Ice::ObjectPrx bb = b->ice_facet(f); + d = new T; + d->__copyFrom(bb); } return d; } diff --git a/cpp/include/Ice/ProxyHandle.h b/cpp/include/Ice/ProxyHandle.h index 6c06e30647b..7229b428bdc 100644 --- a/cpp/include/Ice/ProxyHandle.h +++ b/cpp/include/Ice/ProxyHandle.h @@ -110,171 +110,171 @@ public: ProxyHandle(T* p = 0) { - this->_ptr = p; + this->_ptr = p; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } template<typename Y> ProxyHandle(const ProxyHandle<Y>& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } template<typename Y> ProxyHandle(const ::IceUtil::Handle<Y>& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } ProxyHandle(const ProxyHandle& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - incRef(this->_ptr); - } + if(this->_ptr) + { + incRef(this->_ptr); + } } ~ProxyHandle() { - if(this->_ptr) - { - decRef(this->_ptr); - } + if(this->_ptr) + { + decRef(this->_ptr); + } } ProxyHandle& operator=(T* p) { - if(this->_ptr != p) - { - if(p) - { - incRef(p); - } - - if(this->_ptr) - { - decRef(this->_ptr); - } - - this->_ptr = p; - } - return *this; + if(this->_ptr != p) + { + if(p) + { + incRef(p); + } + + if(this->_ptr) + { + decRef(this->_ptr); + } + + this->_ptr = p; + } + return *this; } template<typename Y> ProxyHandle& operator=(const ProxyHandle<Y>& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - if(this->_ptr) - { - decRef(this->_ptr); - } - - this->_ptr = r._ptr; - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(this->_ptr) + { + decRef(this->_ptr); + } + + this->_ptr = r._ptr; + } + return *this; } template<typename Y> ProxyHandle& operator=(const ::IceUtil::Handle<Y>& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - if(this->_ptr) - { - decRef(this->_ptr); - } - - this->_ptr = r._ptr; - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(this->_ptr) + { + decRef(this->_ptr); + } + + this->_ptr = r._ptr; + } + return *this; } ProxyHandle& operator=(const ProxyHandle& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - incRef(r._ptr); - } - - if(this->_ptr) - { - decRef(this->_ptr); - } - - this->_ptr = r._ptr; - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + incRef(r._ptr); + } + + if(this->_ptr) + { + decRef(this->_ptr); + } + + this->_ptr = r._ptr; + } + return *this; } template<class Y> static ProxyHandle checkedCast(const ProxyHandle<Y>& r) { - Y* tag = 0; - Ice::Context* ctx = 0; - return ::IceInternal::checkedCastHelper<T>(r, tag, ctx); + Y* tag = 0; + Ice::Context* ctx = 0; + return ::IceInternal::checkedCastHelper<T>(r, tag, ctx); } template<class Y> static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f) { - Ice::Context* ctx = 0; - return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, ctx); + Ice::Context* ctx = 0; + return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, ctx); } template<class Y> static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const ::Ice::Context& ctx) { - Y* tag = 0; - return ::IceInternal::checkedCastHelper<T>(r, tag, &ctx); + Y* tag = 0; + return ::IceInternal::checkedCastHelper<T>(r, tag, &ctx); } template<class Y> static ProxyHandle checkedCast(const ProxyHandle<Y>& r, const std::string& f, const ::Ice::Context& ctx) { - return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, &ctx); + return ::IceInternal::checkedCastImpl<ProxyHandle>(r, f, &ctx); } template<class Y> static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r) { - Y* tag = 0; - return::IceInternal::uncheckedCastHelper<T>(r, tag); + Y* tag = 0; + return::IceInternal::uncheckedCastHelper<T>(r, tag); } template<class Y> static ProxyHandle uncheckedCast(const ProxyHandle<Y>& r, const std::string& f) { - return ::IceInternal::uncheckedCastImpl<ProxyHandle>(r, f); + return ::IceInternal::uncheckedCastImpl<ProxyHandle>(r, f); } }; diff --git a/cpp/include/Ice/StringConverter.h b/cpp/include/Ice/StringConverter.h index 634b328c1e3..d2aa1dffa7a 100755 --- a/cpp/include/Ice/StringConverter.h +++ b/cpp/include/Ice/StringConverter.h @@ -47,13 +47,13 @@ public: // past the last byte returned by getMoreBytes). // virtual Byte* toUTF8(const charT* sourceStart, const charT* sourceEnd, - UTF8Buffer&) const = 0; + UTF8Buffer&) const = 0; // // Unmarshals a UTF-8 sequence into a basic_string // virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - std::basic_string<charT>& target) const = 0; + std::basic_string<charT>& target) const = 0; }; typedef BasicStringConverter<char> StringConverter; @@ -71,10 +71,10 @@ class ICE_API UnicodeWstringConverter : public WstringConverter public: virtual Byte* toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, - UTF8Buffer&) const; + UTF8Buffer&) const; virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - std::wstring& target) const; + std::wstring& target) const; }; } #endif diff --git a/cpp/include/IcePatch2/Util.h b/cpp/include/IcePatch2/Util.h index 4467e911d21..fb7a1836277 100644 --- a/cpp/include/IcePatch2/Util.h +++ b/cpp/include/IcePatch2/Util.h @@ -56,30 +56,30 @@ struct FileInfoEqual: public std::binary_function<const FileInfo&, const FileInf bool operator()(const FileInfo& lhs, const FileInfo& rhs) { - if(lhs.path != rhs.path) - { - return false; - } - - // - // For the size portion of the comparison, we only distinquish - // between file (size >= 0) and directory (size == -1). We do - // not take the actual size into account, as it might be set - // to 0 if no compressed file is available. - // - Ice::Int lsz = lhs.size > 0 ? 0 : lhs.size; - Ice::Int rsz = rhs.size > 0 ? 0 : rhs.size; - if(lsz != rsz) - { - return false; - } - - if(lhs.executable != rhs.executable) - { - return false; - } - - return lhs.checksum == rhs.checksum; + if(lhs.path != rhs.path) + { + return false; + } + + // + // For the size portion of the comparison, we only distinquish + // between file (size >= 0) and directory (size == -1). We do + // not take the actual size into account, as it might be set + // to 0 if no compressed file is available. + // + Ice::Int lsz = lhs.size > 0 ? 0 : lhs.size; + Ice::Int rsz = rhs.size > 0 ? 0 : rhs.size; + if(lsz != rsz) + { + return false; + } + + if(lhs.executable != rhs.executable) + { + return false; + } + + return lhs.checksum == rhs.checksum; } }; @@ -88,48 +88,48 @@ struct FileInfoWithoutFlagsLess: public std::binary_function<const FileInfo&, co bool operator()(const FileInfo& lhs, const FileInfo& rhs) { - return compareWithoutFlags(lhs, rhs) < 0; + return compareWithoutFlags(lhs, rhs) < 0; } int compareWithoutFlags(const FileInfo& lhs, const FileInfo& rhs) { - if(lhs.path < rhs.path) - { - return -1; - } - else if(rhs.path < lhs.path) - { - return 1; - } - - // - // For the size portion of the comparison, we only distinquish - // between file (size >= 0) and directory (size == -1). We do - // not take the actual size into account, as it might be set - // to 0 if no compressed file is available. - // - Ice::Int lsz = lhs.size > 0 ? 0 : lhs.size; - Ice::Int rsz = rhs.size > 0 ? 0 : rhs.size; - if(lsz < rsz) - { - return -1; - } - else if(rsz < lsz) - { - return 1; - } - - if(lhs.checksum < rhs.checksum) - { - return -1; - } - else if(rhs.checksum < lhs.checksum) - { - return 1; - } - - return 0; + if(lhs.path < rhs.path) + { + return -1; + } + else if(rhs.path < lhs.path) + { + return 1; + } + + // + // For the size portion of the comparison, we only distinquish + // between file (size >= 0) and directory (size == -1). We do + // not take the actual size into account, as it might be set + // to 0 if no compressed file is available. + // + Ice::Int lsz = lhs.size > 0 ? 0 : lhs.size; + Ice::Int rsz = rhs.size > 0 ? 0 : rhs.size; + if(lsz < rsz) + { + return -1; + } + else if(rsz < lsz) + { + return 1; + } + + if(lhs.checksum < rhs.checksum) + { + return -1; + } + else if(rhs.checksum < lhs.checksum) + { + return 1; + } + + return 0; } }; @@ -138,17 +138,17 @@ struct FileInfoLess : public FileInfoWithoutFlagsLess bool operator()(const FileInfo& lhs, const FileInfo& rhs) { - int rc = compareWithoutFlags(lhs, rhs); - if(rc < 0) - { - return true; - } - else if(rc > 0) - { - return false; - } - - return lhs.executable < rhs.executable; + int rc = compareWithoutFlags(lhs, rhs); + if(rc < 0) + { + return true; + } + else if(rc > 0) + { + return false; + } + + return lhs.executable < rhs.executable; } }; diff --git a/cpp/include/IceStorm/Service.h b/cpp/include/IceStorm/Service.h index 55083fc5faa..ed64dcc45bc 100644 --- a/cpp/include/IceStorm/Service.h +++ b/cpp/include/IceStorm/Service.h @@ -32,11 +32,11 @@ class ICE_STORM_API Service : public ::IceBox::Service public: static ServicePtr create(const Ice::CommunicatorPtr&, - const Ice::ObjectAdapterPtr&, - const Ice::ObjectAdapterPtr&, - const std::string&, - const Ice::Identity&, - const std::string&); + const Ice::ObjectAdapterPtr&, + const Ice::ObjectAdapterPtr&, + const std::string&, + const Ice::Identity&, + const std::string&); virtual void start(const std::string&, const Ice::CommunicatorPtr&, const Ice::StringSeq&) = 0; diff --git a/cpp/include/IceUtil/AbstractMutex.h b/cpp/include/IceUtil/AbstractMutex.h index b2756a71821..1e8b2e0ed3b 100644 --- a/cpp/include/IceUtil/AbstractMutex.h +++ b/cpp/include/IceUtil/AbstractMutex.h @@ -43,17 +43,17 @@ public: virtual void lock() const { - T::lock(); + T::lock(); } virtual void unlock() const { - T::unlock(); + T::unlock(); } virtual bool tryLock() const { - return T::tryLock(); + return T::tryLock(); } virtual ~AbstractMutexI() @@ -72,17 +72,17 @@ public: virtual void lock() const { - T::readLock(); + T::readLock(); } virtual void unlock() const { - T::unlock(); + T::unlock(); } virtual bool tryLock() const { - return T::tryReadLock(); + return T::tryReadLock(); } virtual ~AbstractMutexReadI() @@ -101,17 +101,17 @@ public: virtual void lock() const { - T::writeLock(); + T::writeLock(); } virtual void unlock() const { - T::unlock(); + T::unlock(); } virtual bool tryLock() const { - return T::tryWriteLock(); + return T::tryWriteLock(); } virtual ~AbstractMutexWriteI() diff --git a/cpp/include/IceUtil/Cache.h b/cpp/include/IceUtil/Cache.h index f03afafdbd6..a4d1532a969 100644 --- a/cpp/include/IceUtil/Cache.h +++ b/cpp/include/IceUtil/Cache.h @@ -35,24 +35,24 @@ public: struct Latch : public CountDownLatch { - Latch() : - CountDownLatch(1), - useCount(0) - { - } - int useCount; + Latch() : + CountDownLatch(1), + useCount(0) + { + } + int useCount; }; struct CacheValue { - CacheValue(const Handle<Value>& o) : - obj(o), - latch(0) - { - } - - Handle<Value> obj; - Latch* latch; + CacheValue(const Handle<Value>& o) : + obj(o), + latch(0) + { + } + + Handle<Value> obj; + Latch* latch; }; typedef typename std::map<Key, CacheValue>::iterator Position; @@ -101,11 +101,11 @@ Cache<Key, Value>::getIfPinned(const Key& key) const typename CacheMap::const_iterator p = _map.find(key); if(p != _map.end()) { - return (*p).second.obj; + return (*p).second.obj; } else { - return 0; + return 0; } } @@ -156,7 +156,7 @@ Cache<Key, Value>::pin(const Key& key, const Handle<Value>& obj) if(ir.second) { - pinned(obj, ir.first); + pinned(obj, ir.first); } return ir.second; } @@ -181,145 +181,145 @@ Cache<Key, Value>::pinImpl(const Key& key, const Handle<Value>& newObj) for(;;) { - { - Mutex::Lock sync(_mutex); - - // - // Clean up latch from previous loop - // - if(latch != 0) - { - if(--latch->useCount == 0) - { - delete latch; - } - latch = 0; - } + { + Mutex::Lock sync(_mutex); + + // + // Clean up latch from previous loop + // + if(latch != 0) + { + if(--latch->useCount == 0) + { + delete latch; + } + latch = 0; + } #if defined(_MSC_VER) && (_MSC_VER < 1300) - std::pair<CacheMap::iterator, bool> ir = + std::pair<CacheMap::iterator, bool> ir = #else - std::pair<typename CacheMap::iterator, bool> ir = -#endif - + std::pair<typename CacheMap::iterator, bool> ir = +#endif + #if defined(_MSC_VER) || defined(__BCPLUSPLUS__) - _map.insert(CacheMap::value_type(key, CacheValue(0))); + _map.insert(CacheMap::value_type(key, CacheValue(0))); #else - _map.insert(typename CacheMap::value_type(key, CacheValue(0))); + _map.insert(typename CacheMap::value_type(key, CacheValue(0))); #endif - if(ir.second == false) - { - CacheValue& val = ir.first->second; - if(val.obj != 0) - { - return val.obj; - } - - // - // Otherwise wait - // - if(val.latch == 0) - { - // - // The first queued thread creates the latch - // - val.latch = new Latch; - } - latch = val.latch; - latch->useCount++; - } - - p = ir.first; - } - - if(latch != 0) - { - latch->await(); - - // - // p could be stale now, e.g. some other thread pinned and unpinned the - // object while we were waiting. - // So start over. - // - continue; - } - else - { - Handle<Value> obj; - try - { - obj = load(key); - } - catch(...) - { - { - Mutex::Lock sync(_mutex); - latch = p->second.latch; - p->second.latch = 0; - _map.erase(p); - } - if(latch != 0) - { - assert(latch->getCount() == 1); - latch->countDown(); - } - throw; - } - - { - Mutex::Lock sync(_mutex); - - latch = p->second.latch; - p->second.latch = 0; - - try - { - if(obj != 0) - { - p->second.obj = obj; - pinned(obj, p); - } - else - { - if(newObj == 0) - { - // - // pin() did not find the object - // - - // - // The waiting threads will have to call load() to see by themselves. - // - _map.erase(p); - } - else - { - // - // putIfAbsent() inserts key/newObj - // - p->second.obj = newObj; - pinned(newObj, p); - } - } - } - catch(...) - { - if(latch != 0) - { - assert(latch->getCount() == 1); - latch->countDown(); - } - throw; - } - } - if(latch != 0) - { - assert(latch->getCount() == 1); - latch->countDown(); - } - return obj; - } + if(ir.second == false) + { + CacheValue& val = ir.first->second; + if(val.obj != 0) + { + return val.obj; + } + + // + // Otherwise wait + // + if(val.latch == 0) + { + // + // The first queued thread creates the latch + // + val.latch = new Latch; + } + latch = val.latch; + latch->useCount++; + } + + p = ir.first; + } + + if(latch != 0) + { + latch->await(); + + // + // p could be stale now, e.g. some other thread pinned and unpinned the + // object while we were waiting. + // So start over. + // + continue; + } + else + { + Handle<Value> obj; + try + { + obj = load(key); + } + catch(...) + { + { + Mutex::Lock sync(_mutex); + latch = p->second.latch; + p->second.latch = 0; + _map.erase(p); + } + if(latch != 0) + { + assert(latch->getCount() == 1); + latch->countDown(); + } + throw; + } + + { + Mutex::Lock sync(_mutex); + + latch = p->second.latch; + p->second.latch = 0; + + try + { + if(obj != 0) + { + p->second.obj = obj; + pinned(obj, p); + } + else + { + if(newObj == 0) + { + // + // pin() did not find the object + // + + // + // The waiting threads will have to call load() to see by themselves. + // + _map.erase(p); + } + else + { + // + // putIfAbsent() inserts key/newObj + // + p->second.obj = newObj; + pinned(newObj, p); + } + } + } + catch(...) + { + if(latch != 0) + { + assert(latch->getCount() == 1); + latch->countDown(); + } + throw; + } + } + if(latch != 0) + { + assert(latch->getCount() == 1); + latch->countDown(); + } + return obj; + } } } diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h index 2aedc67952c..ae47c4f6456 100644 --- a/cpp/include/IceUtil/Cond.h +++ b/cpp/include/IceUtil/Cond.h @@ -88,11 +88,11 @@ public: template <typename Lock> inline void wait(const Lock& lock) const { - if(!lock.acquired()) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - waitImpl(lock._mutex); + if(!lock.acquired()) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + waitImpl(lock._mutex); } // @@ -105,11 +105,11 @@ public: template <typename Lock> inline bool timedWait(const Lock& lock, const Time& timeout) const { - if(!lock.acquired()) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - return timedWaitImpl(lock._mutex, timeout); + if(!lock.acquired()) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + return timedWaitImpl(lock._mutex, timeout); } private: @@ -205,7 +205,7 @@ Cond::waitImpl(const M& mutex) const if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__, rc); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } @@ -226,15 +226,15 @@ Cond::timedWaitImpl(const M& mutex, const Time& timeout) const if(rc != 0) { - // - // pthread_cond_timedwait returns ETIMEOUT in the event of a - // timeout. - // - if(rc != ETIMEDOUT) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - return false; + // + // pthread_cond_timedwait returns ETIMEOUT in the event of a + // timeout. + // + if(rc != ETIMEDOUT) + { + throw ThreadSyscallException(__FILE__, __LINE__, rc); + } + return false; } return true; } diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/include/IceUtil/DisableWarnings.h index 1803a0bdc19..ff68c2e0e4b 100644 --- a/cpp/include/IceUtil/DisableWarnings.h +++ b/cpp/include/IceUtil/DisableWarnings.h @@ -21,11 +21,11 @@ // #if defined(_MSC_VER) && _MSC_VER >= 1400 -# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/ +# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/ #endif #if defined(_MSC_VER) && _MSC_VER >= 1300 -# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated +# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated #endif #endif diff --git a/cpp/include/IceUtil/Functional.h b/cpp/include/IceUtil/Functional.h index c0a7bf25623..29effa43b9a 100644 --- a/cpp/include/IceUtil/Functional.h +++ b/cpp/include/IceUtil/Functional.h @@ -32,7 +32,7 @@ public: explicit MemFun(MemberFN p) : _mfn(p) { } R operator()(H handle) const { - return (handle.get() ->* _mfn)(); + return (handle.get() ->* _mfn)(); } }; @@ -47,7 +47,7 @@ public: explicit MemFun1(MemberFN p) : _mfn(p) { } R operator()(H handle, A arg) const { - return (handle.get() ->* _mfn)(arg); + return (handle.get() ->* _mfn)(arg); } }; @@ -62,7 +62,7 @@ public: explicit VoidMemFun(MemberFN p) : _mfn(p) { } void operator()(H handle) const { - (handle.get() ->* _mfn)(); + (handle.get() ->* _mfn)(); } }; @@ -77,7 +77,7 @@ public: explicit VoidMemFun1(MemberFN p) : _mfn(p) { } void operator()(H handle, A arg) const { - (handle.get() ->* _mfn)(arg); + (handle.get() ->* _mfn)(arg); } }; @@ -92,7 +92,7 @@ public: explicit SecondMemFun(MemberFN p) : _mfn(p) { } R operator()(std::pair<K, H> pair) const { - return (pair.second.get() ->* _mfn)(); + return (pair.second.get() ->* _mfn)(); } }; @@ -107,7 +107,7 @@ public: explicit SecondMemFun1(MemberFN p) : _mfn(p) { } R operator()(std::pair<K, H> pair, A arg) const { - return (pair.second.get() ->* _mfn)(arg); + return (pair.second.get() ->* _mfn)(arg); } }; @@ -122,7 +122,7 @@ public: explicit SecondVoidMemFun(MemberFN p) : _mfn(p) { } void operator()(std::pair<K, H> pair) const { - (pair.second.get() ->* _mfn)(); + (pair.second.get() ->* _mfn)(); } }; @@ -137,7 +137,7 @@ public: explicit SecondVoidMemFun1(MemberFN p) : _mfn(p) { } void operator()(std::pair<K, H> pair, A arg) const { - (pair.second.get() ->* _mfn)(arg); + (pair.second.get() ->* _mfn)(arg); } }; @@ -152,7 +152,7 @@ public: explicit ConstMemFun(MemberFN p) : _mfn(p) { } R operator()(H handle) const { - return (handle.get() ->* _mfn)(); + return (handle.get() ->* _mfn)(); } }; @@ -167,7 +167,7 @@ public: explicit ConstMemFun1(MemberFN p) : _mfn(p) { } R operator()(H handle, A arg) const { - return (handle.get() ->* _mfn)(arg); + return (handle.get() ->* _mfn)(arg); } }; @@ -182,7 +182,7 @@ public: explicit ConstVoidMemFun(MemberFN p) : _mfn(p) { } void operator()(H handle) const { - (handle.get() ->* _mfn)(); + (handle.get() ->* _mfn)(); } }; @@ -197,7 +197,7 @@ public: explicit ConstVoidMemFun1(MemberFN p) : _mfn(p) { } void operator()(H handle, A arg) const { - (handle.get() ->* _mfn)(arg); + (handle.get() ->* _mfn)(arg); } }; @@ -212,7 +212,7 @@ public: explicit SecondConstMemFun(MemberFN p) : _mfn(p) { } R operator()(std::pair<K, H> pair) const { - return (pair.second.get() ->* _mfn)(); + return (pair.second.get() ->* _mfn)(); } }; @@ -227,7 +227,7 @@ public: explicit SecondConstMemFun1(MemberFN p) : _mfn(p) { } R operator()(std::pair<K, H> pair, A arg) const { - return (pair.second.get() ->* _mfn)(arg); + return (pair.second.get() ->* _mfn)(arg); } }; @@ -242,7 +242,7 @@ public: explicit SecondConstVoidMemFun(MemberFN p) : _mfn(p) { } void operator()(std::pair<K, H> pair) const { - (pair.second.get() ->* _mfn)(); + (pair.second.get() ->* _mfn)(); } }; @@ -257,7 +257,7 @@ public: explicit SecondConstVoidMemFun1(MemberFN p) : _mfn(p) { } void operator()(std::pair<K, H> pair, A arg) const { - (pair.second.get() ->* _mfn)(arg); + (pair.second.get() ->* _mfn)(arg); } }; diff --git a/cpp/include/IceUtil/Handle.h b/cpp/include/IceUtil/Handle.h index c20616ec21f..0f48e2ee71b 100644 --- a/cpp/include/IceUtil/Handle.h +++ b/cpp/include/IceUtil/Handle.h @@ -29,13 +29,13 @@ public: T* get() const { - return _ptr; + return _ptr; } T* operator->() const { - if(!_ptr) - { + if(!_ptr) + { // // We don't throw directly NullHandleException here to // keep the code size of this method to a minimun (the @@ -43,16 +43,16 @@ public: // than just a function call). This maximises the chances // of inlining by compiler optimization. // - throwNullHandleException(__FILE__, __LINE__); - } + throwNullHandleException(__FILE__, __LINE__); + } - return _ptr; + return _ptr; } T& operator*() const { - if(!_ptr) - { + if(!_ptr) + { // // We don't throw directly NullHandleException here to // keep the code size of this method to a minimun (the @@ -60,20 +60,20 @@ public: // than just a function call). This maximises the chances // of inlining by compiler optimization. // - throwNullHandleException(__FILE__, __LINE__); - } + throwNullHandleException(__FILE__, __LINE__); + } - return *_ptr; + return *_ptr; } operator bool() const { - return _ptr ? true : false; + return _ptr ? true : false; } void swap(HandleBase& other) { - std::swap(_ptr, other._ptr); + std::swap(_ptr, other._ptr); } T* _ptr; @@ -96,12 +96,12 @@ inline bool operator==(const HandleBase<T>& lhs, const HandleBase<U>& rhs) U* r = rhs.get(); if(l && r) { - return *l == *r; + return *l == *r; } else { - return !l && !r; - } + return !l && !r; + } } template<typename T, typename U> @@ -111,12 +111,12 @@ inline bool operator!=(const HandleBase<T>& lhs, const HandleBase<U>& rhs) U* r = rhs.get(); if(l && r) { - return *l != *r; + return *l != *r; } else { - return l || r; - } + return l || r; + } } template<typename T, typename U> @@ -126,11 +126,11 @@ inline bool operator<(const HandleBase<T>& lhs, const HandleBase<U>& rhs) U* r = rhs.get(); if(l && r) { - return *l < *r; + return *l < *r; } else { - return !l && r; + return !l && r; } } @@ -141,111 +141,111 @@ public: Handle(T* p = 0) { - this->_ptr = p; + this->_ptr = p; - if(this->_ptr) - { - this->_ptr->__incRef(); - } + if(this->_ptr) + { + this->_ptr->__incRef(); + } } template<typename Y> Handle(const Handle<Y>& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - this->_ptr->__incRef(); - } + if(this->_ptr) + { + this->_ptr->__incRef(); + } } Handle(const Handle& r) { - this->_ptr = r._ptr; + this->_ptr = r._ptr; - if(this->_ptr) - { - this->_ptr->__incRef(); - } + if(this->_ptr) + { + this->_ptr->__incRef(); + } } ~Handle() { - if(this->_ptr) - { - this->_ptr->__decRef(); - } + if(this->_ptr) + { + this->_ptr->__decRef(); + } } Handle& operator=(T* p) { - if(this->_ptr != p) - { - if(p) - { - p->__incRef(); - } - - T* ptr = this->_ptr; - this->_ptr = p; - - if(ptr) - { - ptr->__decRef(); - } - } - return *this; + if(this->_ptr != p) + { + if(p) + { + p->__incRef(); + } + + T* ptr = this->_ptr; + this->_ptr = p; + + if(ptr) + { + ptr->__decRef(); + } + } + return *this; } template<typename Y> Handle& operator=(const Handle<Y>& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - r._ptr->__incRef(); - } - - T* ptr = this->_ptr; - this->_ptr = r._ptr; - - if(ptr) - { - ptr->__decRef(); - } - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + r._ptr->__incRef(); + } + + T* ptr = this->_ptr; + this->_ptr = r._ptr; + + if(ptr) + { + ptr->__decRef(); + } + } + return *this; } Handle& operator=(const Handle& r) { - if(this->_ptr != r._ptr) - { - if(r._ptr) - { - r._ptr->__incRef(); - } - - T* ptr = this->_ptr; - this->_ptr = r._ptr; - - if(ptr) - { - ptr->__decRef(); - } - } - return *this; + if(this->_ptr != r._ptr) + { + if(r._ptr) + { + r._ptr->__incRef(); + } + + T* ptr = this->_ptr; + this->_ptr = r._ptr; + + if(ptr) + { + ptr->__decRef(); + } + } + return *this; } template<class Y> static Handle dynamicCast(const HandleBase<Y>& r) { #ifdef __BCPLUSPLUS__ - return Handle<T>(dynamic_cast<T*>(r._ptr)); + return Handle<T>(dynamic_cast<T*>(r._ptr)); #else - return Handle(dynamic_cast<T*>(r._ptr)); + return Handle(dynamic_cast<T*>(r._ptr)); #endif } @@ -253,9 +253,9 @@ public: static Handle dynamicCast(Y* p) { #ifdef __BCPLUSPLUS__ - return Handle<T>(dynamic_cast<T*>(p)); + return Handle<T>(dynamic_cast<T*>(p)); #else - return Handle(dynamic_cast<T*>(p)); + return Handle(dynamic_cast<T*>(p)); #endif } }; diff --git a/cpp/include/IceUtil/InputUtil.h b/cpp/include/IceUtil/InputUtil.h index 89ce9990373..480147bffdd 100644 --- a/cpp/include/IceUtil/InputUtil.h +++ b/cpp/include/IceUtil/InputUtil.h @@ -37,8 +37,8 @@ ICE_UTIL_API Int64 strToInt64(const char*, char**, int); // // - return value == true indicates a successful conversion and result contains the converted value // - return value == false indicates an unsuccessful conversion: -// - result == 0 indicates that no digits were available for conversion -// - result == "Int64 Min" or result == "Int64 Max" indicate underflow or overflow. +// - result == 0 indicates that no digits were available for conversion +// - result == "Int64 Min" or result == "Int64 Max" indicate underflow or overflow. // ICE_UTIL_API bool stringToInt64(const std::string&, Int64&); diff --git a/cpp/include/IceUtil/Lock.h b/cpp/include/IceUtil/Lock.h index 9aaf24bcf56..5fdfbddcdd8 100644 --- a/cpp/include/IceUtil/Lock.h +++ b/cpp/include/IceUtil/Lock.h @@ -44,63 +44,63 @@ class LockT public: LockT(const T& mutex) : - _mutex(mutex) + _mutex(mutex) { - _mutex.lock(); - _acquired = true; + _mutex.lock(); + _acquired = true; } ~LockT() { - if (_acquired) - { - _mutex.unlock(); - } + if (_acquired) + { + _mutex.unlock(); + } } void acquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.lock(); - _acquired = true; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.lock(); + _acquired = true; } bool tryAcquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _acquired = _mutex.tryLock(); - return _acquired; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _acquired = _mutex.tryLock(); + return _acquired; } void release() const { - if (!_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.unlock(); - _acquired = false; + if (!_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.unlock(); + _acquired = false; } bool acquired() const { - return _acquired; + return _acquired; } protected: // TryLockT's contructor LockT(const T& mutex, bool) : - _mutex(mutex) + _mutex(mutex) { - _acquired = _mutex.tryLock(); + _acquired = _mutex.tryLock(); } private: @@ -126,7 +126,7 @@ class TryLockT : public LockT<T> public: TryLockT(const T& mutex) : - LockT<T>(mutex, true) + LockT<T>(mutex, true) {} }; diff --git a/cpp/include/IceUtil/Monitor.h b/cpp/include/IceUtil/Monitor.h index 2e9fd0e456f..e64830e0979 100644 --- a/cpp/include/IceUtil/Monitor.h +++ b/cpp/include/IceUtil/Monitor.h @@ -89,11 +89,11 @@ IceUtil::Monitor<T>::lock() const _mutex.lock(); if(_mutex.willUnlock()) { - // - // On the first mutex acquisition reset the number pending - // notifications. - // - _nnotify = 0; + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; } } @@ -102,10 +102,10 @@ IceUtil::Monitor<T>::unlock() const { if(_mutex.willUnlock()) { - // - // Perform any pending notifications. - // - notifyImpl(_nnotify); + // + // Perform any pending notifications. + // + notifyImpl(_nnotify); } _mutex.unlock(); @@ -113,10 +113,10 @@ IceUtil::Monitor<T>::unlock() const int nnotify = _nnotify; if(_mutex.unlock()) { - // - // Perform any pending notifications. - // - notifyImpl(nnotify); + // + // Perform any pending notifications. + // + notifyImpl(nnotify); } */ } @@ -127,11 +127,11 @@ IceUtil::Monitor<T>::tryLock() const bool result = _mutex.tryLock(); if(result && _mutex.willUnlock()) { - // - // On the first mutex acquisition reset the number pending - // notifications. - // - _nnotify = 0; + // + // On the first mutex acquisition reset the number pending + // notifications. + // + _nnotify = 0; } return result; } @@ -149,15 +149,15 @@ IceUtil::Monitor<T>::wait() const // try { - _cond.waitImpl(_mutex); - // - // Reset the nnotify count once wait() returns. - // + _cond.waitImpl(_mutex); + // + // Reset the nnotify count once wait() returns. + // } catch(...) { - _nnotify = 0; - throw; + _nnotify = 0; + throw; } _nnotify = 0; @@ -177,16 +177,16 @@ IceUtil::Monitor<T>::timedWait(const Time& timeout) const // try { - rc = _cond.timedWaitImpl(_mutex, timeout); + rc = _cond.timedWaitImpl(_mutex, timeout); - // - // Reset the nnotify count once wait() returns. - // + // + // Reset the nnotify count once wait() returns. + // } catch(...) { - _nnotify = 0; - throw; + _nnotify = 0; + throw; } _nnotify = 0; @@ -202,7 +202,7 @@ IceUtil::Monitor<T>::notify() // if(_nnotify != -1) { - ++_nnotify; + ++_nnotify; } } @@ -224,25 +224,25 @@ IceUtil::Monitor<T>::notifyImpl(int nnotify) const // if(nnotify != 0) { - // - // -1 means notifyAll. - // - if(nnotify == -1) - { - _cond.broadcast(); - return; - } - else - { - // - // Otherwise notify n times. - // - while(nnotify > 0) - { - _cond.signal(); - --nnotify; - } - } + // + // -1 means notifyAll. + // + if(nnotify == -1) + { + _cond.broadcast(); + return; + } + else + { + // + // Otherwise notify n times. + // + while(nnotify > 0) + { + _cond.signal(); + --nnotify; + } + } } } diff --git a/cpp/include/IceUtil/Mutex.h b/cpp/include/IceUtil/Mutex.h index da2c36b9bca..ca08324d28b 100644 --- a/cpp/include/IceUtil/Mutex.h +++ b/cpp/include/IceUtil/Mutex.h @@ -87,7 +87,7 @@ private: #else struct LockState { - pthread_mutex_t* mutex; + pthread_mutex_t* mutex; }; #endif @@ -140,12 +140,12 @@ Mutex::tryLock() const { if(!TryEnterCriticalSection(&_mutex)) { - return false; + return false; } if(_mutex.RecursionCount > 1) { - LeaveCriticalSection(&_mutex); - throw ThreadLockedException(__FILE__, __LINE__); + LeaveCriticalSection(&_mutex); + throw ThreadLockedException(__FILE__, __LINE__); } return true; } @@ -178,7 +178,7 @@ Mutex::Mutex() : _mutex = CreateMutex(0, false, 0); if(_mutex == 0) { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -188,7 +188,7 @@ Mutex::~Mutex() BOOL rc = CloseHandle(_mutex); if(rc == 0) { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -198,14 +198,14 @@ Mutex::lock() const DWORD rc = WaitForSingleObject(_mutex, INFINITE); if(rc != WAIT_OBJECT_0) { - if(rc == WAIT_FAILED) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, 0); - } + if(rc == WAIT_FAILED) + { + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, 0); + } } _recursionCount++; } @@ -216,18 +216,18 @@ Mutex::tryLock() const DWORD rc = WaitForSingleObject(_mutex, 0); if(rc != WAIT_OBJECT_0) { - return false; + return false; } else if(_recursionCount == 1) { - _recursionCount++; - unlock(); - throw ThreadLockedException(__FILE__, __LINE__); + _recursionCount++; + unlock(); + throw ThreadLockedException(__FILE__, __LINE__); } else { - _recursionCount++; - return true; + _recursionCount++; + return true; } } @@ -238,7 +238,7 @@ Mutex::unlock() const BOOL rc = ReleaseMutex(_mutex); if(rc == 0) { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -287,7 +287,7 @@ Mutex::Mutex() if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__, rc); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } @@ -306,13 +306,13 @@ Mutex::lock() const if(rc != 0) { if(rc == EDEADLK) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } + { + throw ThreadLockedException(__FILE__, __LINE__); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, rc); + } } } @@ -323,13 +323,13 @@ Mutex::tryLock() const if(rc != 0 && rc != EBUSY) { if(rc == EDEADLK) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } + { + throw ThreadLockedException(__FILE__, __LINE__); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, rc); + } } return (rc == 0); } @@ -340,7 +340,7 @@ Mutex::unlock() const int rc = pthread_mutex_unlock(&_mutex); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__, rc); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } diff --git a/cpp/include/IceUtil/Options.h b/cpp/include/IceUtil/Options.h index f7af12c47a5..ef14133eb7e 100755 --- a/cpp/include/IceUtil/Options.h +++ b/cpp/include/IceUtil/Options.h @@ -87,10 +87,10 @@ private: struct OptionDetails : public IceUtil::Shared { - LengthType length; - ArgType arg; + LengthType length; + ArgType arg; RepeatType repeat; - bool hasDefault; + bool hasDefault; }; typedef IceUtil::Handle<OptionDetails> ODPtr; diff --git a/cpp/include/IceUtil/OutputUtil.h b/cpp/include/IceUtil/OutputUtil.h index c6b6c021f89..ec86158f1d1 100644 --- a/cpp/include/IceUtil/OutputUtil.h +++ b/cpp/include/IceUtil/OutputUtil.h @@ -127,7 +127,7 @@ operator<<(Output& out, const std::vector<T>& val) { for(typename std::vector<T>::const_iterator p = val.begin(); p != val.end(); ++p) { - out << *p; + out << *p; } return out; } @@ -145,7 +145,7 @@ operator<<(Output& out, std::vector<T>& val) { for(typename std::vector<T>::const_iterator p = val.begin(); p != val.end(); ++p) { - out << *p; + out << *p; } return out; } diff --git a/cpp/include/IceUtil/RWRecMutex.h b/cpp/include/IceUtil/RWRecMutex.h index bdcefeb676d..396aae37cf3 100644 --- a/cpp/include/IceUtil/RWRecMutex.h +++ b/cpp/include/IceUtil/RWRecMutex.h @@ -37,83 +37,83 @@ class RLockT public: RLockT(const T& mutex) : - _mutex(mutex) + _mutex(mutex) { - _mutex.readLock(); - _acquired = true; + _mutex.readLock(); + _acquired = true; } ~RLockT() { - if (_acquired) - { - _mutex.unlock(); - } + if (_acquired) + { + _mutex.unlock(); + } } void acquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.readLock(); - _acquired = true; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.readLock(); + _acquired = true; } bool tryAcquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _acquired = _mutex.tryReadLock(); - return _acquired; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _acquired = _mutex.tryReadLock(); + return _acquired; } bool timedAcquire(const Time& timeout) const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _acquired = _mutex.timedReadLock(timeout); - return _acquired; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _acquired = _mutex.timedReadLock(timeout); + return _acquired; } void release() const { - if (!_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.unlock(); - _acquired = false; + if (!_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.unlock(); + _acquired = false; } bool acquired() const { - return _acquired; + return _acquired; } void upgrade() const { - _mutex.upgrade(); + _mutex.upgrade(); } bool timedUpgrade(const Time& timeout) const { - return _mutex.timedUpgrade(timeout); + return _mutex.timedUpgrade(timeout); } void downgrade() const { - _mutex.downgrade(); + _mutex.downgrade(); } protected: @@ -121,16 +121,16 @@ protected: // TryRLockT's constructors RLockT(const T& mutex, bool) : - _mutex(mutex) + _mutex(mutex) { - _acquired = _mutex.tryReadLock(); + _acquired = _mutex.tryReadLock(); } RLockT(const T& mutex, const Time& timeout) : - _mutex(mutex) + _mutex(mutex) { - _acquired = _mutex.timedReadLock(timeout); + _acquired = _mutex.timedReadLock(timeout); } @@ -151,12 +151,12 @@ class TryRLockT : public RLockT<T> public: TryRLockT(const T& mutex) : - RLockT<T>(mutex, true) + RLockT<T>(mutex, true) { } TryRLockT(const T& mutex, const Time& timeout) : - RLockT<T>(mutex, timeout) + RLockT<T>(mutex, timeout) { } }; @@ -167,63 +167,63 @@ class WLockT public: WLockT(const T& mutex) : - _mutex(mutex) + _mutex(mutex) { - _mutex.writeLock(); - _acquired = true; + _mutex.writeLock(); + _acquired = true; } ~WLockT() { - if (_acquired) - { - _mutex.unlock(); - } + if (_acquired) + { + _mutex.unlock(); + } } void acquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.writeLock(); - _acquired = true; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.writeLock(); + _acquired = true; } bool tryAcquire() const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _acquired = _mutex.tryWriteLock(); - return _acquired; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _acquired = _mutex.tryWriteLock(); + return _acquired; } bool timedAcquire(const Time& timeout) const { - if (_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _acquired = _mutex.timedWriteLock(timeout); - return _acquired; + if (_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _acquired = _mutex.timedWriteLock(timeout); + return _acquired; } void release() const { - if (!_acquired) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - _mutex.unlock(); - _acquired = false; + if (!_acquired) + { + throw ThreadLockedException(__FILE__, __LINE__); + } + _mutex.unlock(); + _acquired = false; } bool acquired() const { - return _acquired; + return _acquired; } protected: @@ -231,15 +231,15 @@ protected: // TryWLockT's constructor WLockT(const T& mutex, bool) : - _mutex(mutex) + _mutex(mutex) { - _acquired = _mutex.tryWriteLock(); + _acquired = _mutex.tryWriteLock(); } WLockT(const T& mutex, const Time& timeout) : - _mutex(mutex) + _mutex(mutex) { - _acquired = _mutex.timedWriteLock(timeout); + _acquired = _mutex.timedWriteLock(timeout); } private: @@ -259,12 +259,12 @@ class TryWLockT : public WLockT<T> public: TryWLockT(const T& mutex) : - WLockT<T>(mutex, true) + WLockT<T>(mutex, true) { } TryWLockT(const T& mutex, const Time& timeout) : - WLockT<T>(mutex, timeout) + WLockT<T>(mutex, timeout) { } }; diff --git a/cpp/include/IceUtil/RecMutex.h b/cpp/include/IceUtil/RecMutex.h index 898123834c4..5c89feb21b2 100644 --- a/cpp/include/IceUtil/RecMutex.h +++ b/cpp/include/IceUtil/RecMutex.h @@ -78,13 +78,13 @@ private: #ifdef _WIN32 struct LockState { - int count; + int count; }; #else struct LockState { - pthread_mutex_t* mutex; - int count; + pthread_mutex_t* mutex; + int count; }; #endif diff --git a/cpp/include/IceUtil/ScopedArray.h b/cpp/include/IceUtil/ScopedArray.h index edc033f0c8c..52be7c0ae12 100644 --- a/cpp/include/IceUtil/ScopedArray.h +++ b/cpp/include/IceUtil/ScopedArray.h @@ -28,25 +28,25 @@ public: ~ScopedArray() { if(_ptr != 0) - { - delete[] _ptr; - } + { + delete[] _ptr; + } } void reset(T* ptr = 0) { - assert(ptr == 0 || ptr != _ptr); + assert(ptr == 0 || ptr != _ptr); if(_ptr != 0) - { - delete[] _ptr; - } - _ptr = ptr; + { + delete[] _ptr; + } + _ptr = ptr; } T& operator[](size_t i) const { - assert(_ptr != 0); - assert(i >= 0); + assert(_ptr != 0); + assert(i >= 0); return _ptr[i]; } @@ -58,8 +58,8 @@ public: void swap(ScopedArray& a) { T* tmp = a._ptr; - a._ptr = _ptr; - _ptr = tmp; + a._ptr = _ptr; + _ptr = tmp; } private: diff --git a/cpp/include/IceUtil/Shared.h b/cpp/include/IceUtil/Shared.h index 8abb33f0c34..c80b6b35c5b 100644 --- a/cpp/include/IceUtil/Shared.h +++ b/cpp/include/IceUtil/Shared.h @@ -62,9 +62,9 @@ inline void ice_atomic_set(ice_atomic_t* v, int i) inline void ice_atomic_inc(ice_atomic_t *v) { __asm__ __volatile__( - "lock ; incl %0" - :"=m" (v->counter) - :"m" (v->counter)); + "lock ; incl %0" + :"=m" (v->counter) + :"m" (v->counter)); } /** @@ -81,9 +81,9 @@ 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"); + "lock ; decl %0; sete %1" + :"=m" (v->counter), "=qm" (c) + :"m" (v->counter) : "memory"); return c != 0; } @@ -98,10 +98,10 @@ 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"); + "lock ; xadd %0,(%2)" + :"+r"(tmp), "=m"(v->counter) + :"r"(v), "m"(v->counter) + : "memory"); return tmp + i; } @@ -148,31 +148,31 @@ public: void __incRef() { - assert(_ref >= 0); - ++_ref; + assert(_ref >= 0); + ++_ref; } void __decRef() { - assert(_ref > 0); - if(--_ref == 0) - { - if(!_noDelete) - { - _noDelete = true; - delete this; - } - } + assert(_ref > 0); + if(--_ref == 0) + { + if(!_noDelete) + { + _noDelete = true; + delete this; + } + } } int __getRef() const { - return _ref; + return _ref; } void __setNoDelete(bool b) { - _noDelete = b; + _noDelete = b; } private: @@ -200,49 +200,49 @@ public: void __incRef() { #if defined(_WIN32) - assert(InterlockedExchangeAdd(&_ref, 0) >= 0); - InterlockedIncrement(&_ref); + assert(InterlockedExchangeAdd(&_ref, 0) >= 0); + InterlockedIncrement(&_ref); #elif defined(ICE_HAS_ATOMIC_FUNCTIONS) - assert(ice_atomic_exchange_add(0, &_ref) >= 0); - ice_atomic_inc(&_ref); + assert(ice_atomic_exchange_add(0, &_ref) >= 0); + ice_atomic_inc(&_ref); #else - _mutex.lock(); - assert(_ref >= 0); - ++_ref; - _mutex.unlock(); + _mutex.lock(); + assert(_ref >= 0); + ++_ref; + _mutex.unlock(); #endif } void __decRef() { #if defined(_WIN32) - assert(InterlockedExchangeAdd(&_ref, 0) > 0); - if(InterlockedDecrement(&_ref) == 0 && !_noDelete) - { - _noDelete = true; - delete this; - } + assert(InterlockedExchangeAdd(&_ref, 0) > 0); + if(InterlockedDecrement(&_ref) == 0 && !_noDelete) + { + _noDelete = true; + delete this; + } #elif defined(ICE_HAS_ATOMIC_FUNCTIONS) - assert(ice_atomic_exchange_add(0, &_ref) > 0); - if(ice_atomic_dec_and_test(&_ref) && !_noDelete) - { - _noDelete = true; - delete this; - } + assert(ice_atomic_exchange_add(0, &_ref) > 0); + if(ice_atomic_dec_and_test(&_ref) && !_noDelete) + { + _noDelete = true; + delete this; + } #else - _mutex.lock(); - bool doDelete = false; - assert(_ref > 0); - if(--_ref == 0) - { - doDelete = !_noDelete; - _noDelete = true; - } - _mutex.unlock(); - if(doDelete) - { - delete this; - } + _mutex.lock(); + bool doDelete = false; + assert(_ref > 0); + if(--_ref == 0) + { + doDelete = !_noDelete; + _noDelete = true; + } + _mutex.unlock(); + if(doDelete) + { + delete this; + } #endif } diff --git a/cpp/include/IceUtil/StaticMutex.h b/cpp/include/IceUtil/StaticMutex.h index bf67e79635e..4bf6ccf2fad 100644 --- a/cpp/include/IceUtil/StaticMutex.h +++ b/cpp/include/IceUtil/StaticMutex.h @@ -95,7 +95,7 @@ private: #else struct LockState { - pthread_mutex_t* mutex; + pthread_mutex_t* mutex; }; #endif @@ -149,7 +149,7 @@ StaticMutex::lock() const { if(!initialized()) { - initialize(); + initialize(); } EnterCriticalSection(_mutex); assert(_mutex->RecursionCount == 1); @@ -160,16 +160,16 @@ StaticMutex::tryLock() const { if(!initialized()) { - initialize(); + initialize(); } if(!TryEnterCriticalSection(_mutex)) { - return false; + return false; } if(_mutex->RecursionCount > 1) { - LeaveCriticalSection(_mutex); - throw ThreadLockedException(__FILE__, __LINE__); + LeaveCriticalSection(_mutex); + throw ThreadLockedException(__FILE__, __LINE__); } return true; } @@ -195,7 +195,7 @@ StaticMutex::lock(LockState&) const { if(!initialized()) { - initialize(); + initialize(); } EnterCriticalSection(_mutex); } @@ -207,20 +207,20 @@ StaticMutex::lock() const { if(!initialized()) { - initialize(); + initialize(); } DWORD rc = WaitForSingleObject(_mutex, INFINITE); if(rc != WAIT_OBJECT_0) { - if(rc == WAIT_FAILED) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, 0); - } + if(rc == WAIT_FAILED) + { + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, 0); + } } _recursionCount++; assert(_recursionCount == 1); @@ -231,24 +231,24 @@ StaticMutex::tryLock() const { if(!initialized()) { - initialize(); + initialize(); } DWORD rc = WaitForSingleObject(_mutex, 0); if(rc != WAIT_OBJECT_0) { - return false; + return false; } else if(_recursionCount == 1) { - _recursionCount++; - unlock(); - throw ThreadLockedException(__FILE__, __LINE__); + _recursionCount++; + unlock(); + throw ThreadLockedException(__FILE__, __LINE__); } else { - _recursionCount++; - return true; + _recursionCount++; + return true; } } @@ -259,7 +259,7 @@ StaticMutex::unlock() const BOOL rc = ReleaseMutex(_mutex); if(rc == 0) { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -286,13 +286,13 @@ StaticMutex::lock() const if(rc != 0) { if(rc == EDEADLK) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } + { + throw ThreadLockedException(__FILE__, __LINE__); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, rc); + } } } @@ -303,13 +303,13 @@ StaticMutex::tryLock() const if(rc != 0 && rc != EBUSY) { if(rc == EDEADLK) - { - throw ThreadLockedException(__FILE__, __LINE__); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } + { + throw ThreadLockedException(__FILE__, __LINE__); + } + else + { + throw ThreadSyscallException(__FILE__, __LINE__, rc); + } } return (rc == 0); } @@ -320,7 +320,7 @@ StaticMutex::unlock() const int rc = pthread_mutex_unlock(&_mutex); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__, rc); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h index ce70f933336..f46182b2476 100644 --- a/cpp/include/IceUtil/Thread.h +++ b/cpp/include/IceUtil/Thread.h @@ -140,8 +140,8 @@ protected: #endif private: - Thread(const Thread&); // Copying is forbidden - void operator=(const Thread&); // Assignment is forbidden + Thread(const Thread&); // Copying is forbidden + void operator=(const Thread&); // Assignment is forbidden }; typedef Handle<Thread> ThreadPtr; diff --git a/cpp/include/IceUtil/Time.h b/cpp/include/IceUtil/Time.h index 857c9a680d0..b2b5981776a 100644 --- a/cpp/include/IceUtil/Time.h +++ b/cpp/include/IceUtil/Time.h @@ -51,142 +51,142 @@ public: Time operator-() const { - return Time(-_usec); + return Time(-_usec); } Time operator-(const Time& rhs) const { - return Time(_usec - rhs._usec); + return Time(_usec - rhs._usec); } Time operator+(const Time& rhs) const { - return Time(_usec + rhs._usec); + return Time(_usec + rhs._usec); } Time& operator+=(const Time& rhs) { - _usec += rhs._usec; - return *this; + _usec += rhs._usec; + return *this; } Time& operator-=(const Time& rhs) { - _usec -= rhs._usec; - return *this; + _usec -= rhs._usec; + return *this; } bool operator<(const Time& rhs) const { - return _usec < rhs._usec; + return _usec < rhs._usec; } bool operator<=(const Time& rhs) const { - return _usec <= rhs._usec; + return _usec <= rhs._usec; } bool operator>(const Time& rhs) const { - return _usec > rhs._usec; + return _usec > rhs._usec; } bool operator>=(const Time& rhs) const { - return _usec >= rhs._usec; + return _usec >= rhs._usec; } bool operator==(const Time& rhs) const { - return _usec == rhs._usec; + return _usec == rhs._usec; } bool operator!=(const Time& rhs) const { - return _usec != rhs._usec; + return _usec != rhs._usec; } double operator/(const Time& rhs) const { - return (double)_usec / (double)rhs._usec; + return (double)_usec / (double)rhs._usec; } Time& operator*=(int rhs) { - _usec *= rhs; - return *this; + _usec *= rhs; + return *this; } Time operator*(int rhs) const { - Time t; - t._usec = _usec * rhs; - return t; + Time t; + t._usec = _usec * rhs; + return t; } Time& operator/=(int rhs) { - _usec /= rhs; - return *this; + _usec /= rhs; + return *this; } Time operator/(int rhs) const { - Time t; - t._usec = _usec / rhs; - return t; + Time t; + t._usec = _usec / rhs; + return t; } Time& operator*=(Int64 rhs) { - _usec *= rhs; - return *this; + _usec *= rhs; + return *this; } Time operator*(Int64 rhs) const { - Time t; - t._usec = _usec * rhs; - return t; + Time t; + t._usec = _usec * rhs; + return t; } Time& operator/=(Int64 rhs) { - _usec /= rhs; - return *this; + _usec /= rhs; + return *this; } Time operator/(Int64 rhs) const { - Time t; - t._usec = _usec / rhs; - return t; + Time t; + t._usec = _usec / rhs; + return t; } Time& operator*=(double rhs) { - _usec = static_cast<Int64>(static_cast<double>(_usec) * rhs); - return *this; + _usec = static_cast<Int64>(static_cast<double>(_usec) * rhs); + return *this; } Time operator*(double rhs) const { - Time t; - t._usec = static_cast<Int64>(static_cast<double>(_usec) * rhs); - return t; + Time t; + t._usec = static_cast<Int64>(static_cast<double>(_usec) * rhs); + return t; } Time& operator/=(double rhs) { - _usec = static_cast<Int64>(static_cast<double>(_usec) / rhs); - return *this; + _usec = static_cast<Int64>(static_cast<double>(_usec) / rhs); + return *this; } Time operator/(double rhs) const { - Time t; - t._usec = static_cast<Int64>(static_cast<double>(_usec) / rhs); - return t; + Time t; + t._usec = static_cast<Int64>(static_cast<double>(_usec) / rhs); + return t; } private: diff --git a/cpp/include/IceUtil/Unicode.h b/cpp/include/IceUtil/Unicode.h index caebf5b2a5d..03c95a3fa56 100644 --- a/cpp/include/IceUtil/Unicode.h +++ b/cpp/include/IceUtil/Unicode.h @@ -97,10 +97,10 @@ ICE_UTIL_API std::wstring stringToWstring(const std::string&); enum ConversionResult { - conversionOK, /* conversion successful */ - sourceExhausted, /* partial character in source, but hit end */ - targetExhausted, /* insuff. room in target for conversion */ - sourceIllegal /* source sequence is illegal/malformed */ + conversionOK, /* conversion successful */ + sourceExhausted, /* partial character in source, but hit end */ + targetExhausted, /* insuff. room in target for conversion */ + sourceIllegal /* source sequence is illegal/malformed */ }; @@ -117,15 +117,15 @@ isLegalUTF8Sequence(const Byte* source, const Byte* end); ICE_UTIL_API ConversionResult convertUTFWstringToUTF8(const wchar_t*& sourceStart, const wchar_t* sourceEnd, - Byte*& targetStart, Byte* targetEnd, ConversionFlags flags); + Byte*& targetStart, Byte* targetEnd, ConversionFlags flags); ICE_UTIL_API ConversionResult convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd, - wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags); + wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags); ICE_UTIL_API ConversionResult convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd, - std::wstring& target, ConversionFlags flags); + std::wstring& target, ConversionFlags flags); diff --git a/cpp/include/Slice/CPlusPlusUtil.h b/cpp/include/Slice/CPlusPlusUtil.h index ae4af4cae89..7fb3f900a4c 100644 --- a/cpp/include/Slice/CPlusPlusUtil.h +++ b/cpp/include/Slice/CPlusPlusUtil.h @@ -36,14 +36,14 @@ SLICE_API std::string operationModeToString(Operation::Mode); SLICE_API std::string fixKwd(const std::string&); SLICE_API void writeMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool, - const std::string& = "", bool = true, const StringList& = StringList(), - bool = false); + const std::string& = "", bool = true, const StringList& = StringList(), + bool = false); SLICE_API void writeMarshalCode(::IceUtil::Output&, const ParamDeclList&, const TypePtr&, - const StringList&, bool = false); + const StringList&, bool = false); SLICE_API void writeUnmarshalCode(::IceUtil::Output&, const ParamDeclList&, const TypePtr&, - const StringList&, bool = false); + const StringList&, bool = false); SLICE_API void writeAllocateCode(::IceUtil::Output&, const ParamDeclList&, const TypePtr&, - const StringList&, bool = false, bool = false); + const StringList&, bool = false, bool = false); SLICE_API void writeStreamMarshalUnmarshalCode(::IceUtil::Output&, const TypePtr&, const std::string&, bool, const std::string& = "", bool = false, const StringList& = StringList()); SLICE_API std::string findMetaData(const StringList&, bool); diff --git a/cpp/include/Slice/CsUtil.h b/cpp/include/Slice/CsUtil.h index 90a53540d51..28c8b577c87 100644 --- a/cpp/include/Slice/CsUtil.h +++ b/cpp/include/Slice/CsUtil.h @@ -74,7 +74,7 @@ private: void validate(const ContainedPtr&); StringSet _history; - bool _globalMetaDataDone; + bool _globalMetaDataDone; }; }; diff --git a/cpp/include/Slice/JavaUtil.h b/cpp/include/Slice/JavaUtil.h index decc474943b..75bc163a1f1 100644 --- a/cpp/include/Slice/JavaUtil.h +++ b/cpp/include/Slice/JavaUtil.h @@ -115,14 +115,14 @@ protected: // to typeToString. // std::string typeToObjectString(const TypePtr&, TypeMode, const std::string& = std::string(), - const StringList& = StringList(), bool = true) const; + const StringList& = StringList(), bool = true) 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 StringList& = StringList(), - const std::string& patchParams = ""); + const std::string& patchParams = ""); // // Generate code to marshal or unmarshal a dictionary type. @@ -143,7 +143,7 @@ protected: // void writeStreamMarshalUnmarshalCode(::IceUtil::Output&, const std::string&, const TypePtr&, const std::string&, bool, int&, bool = false, const StringList& = StringList(), - const std::string& patchParams = ""); + const std::string& patchParams = ""); // // Generate code to marshal or unmarshal a dictionary type using the public stream API. @@ -179,9 +179,9 @@ protected: // the default mapping was used. // bool getDictionaryTypes(const DictionaryPtr&, const std::string&, const StringList&, - std::string&, std::string&) const; + std::string&, std::string&) const; bool getSequenceTypes(const SequencePtr&, const std::string&, const StringList&, - std::string&, std::string&) const; + std::string&, std::string&) const; virtual JavaOutput* createOutput(); @@ -212,8 +212,8 @@ private: private: StringList getMetaData(const ContainedPtr&); - void validateType(const SyntaxTreeBasePtr&, const StringList&, const std::string&, const std::string&); - void validateGetSet(const SyntaxTreeBasePtr&, const StringList&, const std::string&, const std::string&); + void validateType(const SyntaxTreeBasePtr&, const StringList&, const std::string&, const std::string&); + void validateGetSet(const SyntaxTreeBasePtr&, const StringList&, const std::string&, const std::string&); StringSet _history; }; diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index d13965b46ad..d903cae03b0 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -283,17 +283,17 @@ public: enum Kind { - KindByte, - KindBool, - KindShort, - KindInt, - KindLong, - KindFloat, - KindDouble, - KindString, - KindObject, - KindObjectProxy, - KindLocalObject + KindByte, + KindBool, + KindShort, + KindInt, + KindLong, + KindFloat, + KindDouble, + KindString, + KindObject, + KindObjectProxy, + KindLocalObject }; virtual bool isLocal() const; @@ -343,18 +343,18 @@ public: enum ContainedType { - ContainedTypeSequence, - ContainedTypeDictionary, - ContainedTypeEnum, - ContainedTypeEnumerator, - ContainedTypeModule, - ContainedTypeClass, - ContainedTypeException, - ContainedTypeStruct, - ContainedTypeOperation, - ContainedTypeParamDecl, - ContainedTypeDataMember, - ContainedTypeConstant + ContainedTypeSequence, + ContainedTypeDictionary, + ContainedTypeEnum, + ContainedTypeEnumerator, + ContainedTypeModule, + ContainedTypeClass, + ContainedTypeException, + ContainedTypeStruct, + ContainedTypeOperation, + ContainedTypeParamDecl, + ContainedTypeDataMember, + ContainedTypeConstant }; virtual ContainedType containedType() const = 0; @@ -396,11 +396,11 @@ public: StructPtr createStruct(const std::string&, bool); SequencePtr createSequence(const std::string&, const TypePtr&, const StringList&, bool); DictionaryPtr createDictionary(const std::string&, const TypePtr&, const StringList&, const TypePtr&, - const StringList&, bool); + const StringList&, bool); EnumPtr createEnum(const std::string&, bool); EnumeratorPtr createEnumerator(const std::string&); ConstPtr createConst(const std::string, const TypePtr&, const StringList&, const SyntaxTreeBasePtr&, - const std::string&); + const std::string&); TypeList lookupType(const std::string&, bool = true); TypeList lookupTypeNoBuiltin(const std::string&, bool = true); ContainedList lookupContained(const std::string&, bool = true); @@ -543,9 +543,9 @@ public: // enum Mode { - Normal, - Nonmutating, - Idempotent + Normal, + Nonmutating, + Idempotent }; TypePtr returnType() const; @@ -762,7 +762,7 @@ public: protected: Dictionary(const ContainerPtr&, const std::string&, const TypePtr&, const StringList&, const TypePtr&, - const StringList&, bool); + const StringList&, bool); friend class Container; TypePtr _keyType; @@ -839,7 +839,7 @@ public: static bool isLegalType(const std::string&, const TypePtr&, const UnitPtr&); static bool typesAreCompatible(const std::string&, const TypePtr&, - const SyntaxTreeBasePtr&, const std::string&, const UnitPtr&); + const SyntaxTreeBasePtr&, const std::string&, const UnitPtr&); static bool isInRange(const std::string&, const TypePtr&, const std::string&, const UnitPtr&); protected: diff --git a/cpp/include/Slice/VbUtil.h b/cpp/include/Slice/VbUtil.h index 704caf8c743..62939d78b23 100644 --- a/cpp/include/Slice/VbUtil.h +++ b/cpp/include/Slice/VbUtil.h @@ -72,7 +72,7 @@ private: void validate(const ContainedPtr&); StringSet _history; - bool _globalMetaDataDone; + bool _globalMetaDataDone; }; }; |