diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-16 12:07:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-16 12:07:03 +0200 |
commit | 0a95a3e57d152f154af5d07d537e0c99b374a20f (patch) | |
tree | 6f4df0401292122c85fd1c9faeb28e3c4e8da1d6 | |
parent | c56f32eb5e0b88ef8297a691f5286ba4aa4aa8b4 (diff) |
Make use of const style consistent
-rw-r--r-- | odb/database.hxx | 10 | ||||
-rw-r--r-- | odb/database.txx | 10 | ||||
-rw-r--r-- | odb/exception.cxx | 2 | ||||
-rw-r--r-- | odb/exception.hxx | 2 | ||||
-rw-r--r-- | odb/shared-ptr.hxx | 8 | ||||
-rw-r--r-- | odb/shared-ptr/base.cxx | 2 | ||||
-rw-r--r-- | odb/shared-ptr/base.hxx | 8 | ||||
-rw-r--r-- | odb/shared-ptr/base.ixx | 4 | ||||
-rw-r--r-- | odb/shared-ptr/base.txx | 32 |
9 files changed, 39 insertions, 39 deletions
diff --git a/odb/database.hxx b/odb/database.hxx index 0a993d5..1f08daf 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -35,21 +35,21 @@ namespace odb // template <typename T> typename object_traits<T>::pointer_type - load (typename object_traits<T>::id_type const& id); + load (const typename object_traits<T>::id_type& id); template <typename T> void - load (typename object_traits<T>::id_type const& id, T& object); + load (const typename object_traits<T>::id_type& id, T& object); // Return NULL/false if not found. // template <typename T> typename object_traits<T>::pointer_type - find (typename object_traits<T>::id_type const& id); + find (const typename object_traits<T>::id_type& id); template <typename T> bool - find (typename object_traits<T>::id_type const& id, T& object); + find (const typename object_traits<T>::id_type& id, T& object); // Save the state of a modified objects. // @@ -66,7 +66,7 @@ namespace odb template <typename T> void - erase (typename object_traits<T>::id_type const& id); + erase (const typename object_traits<T>::id_type& id); // Object query API. // diff --git a/odb/database.txx b/odb/database.txx index bec3234..377df21 100644 --- a/odb/database.txx +++ b/odb/database.txx @@ -26,7 +26,7 @@ namespace odb template <typename T> typename object_traits<T>::pointer_type database:: - load (typename object_traits<T>::id_type const& id) + load (const typename object_traits<T>::id_type& id) { typedef object_traits<T> traits; @@ -40,7 +40,7 @@ namespace odb template <typename T> void database:: - load (typename object_traits<T>::id_type const& id, T& obj) + load (const typename object_traits<T>::id_type& id, T& obj) { if (!find<T> (id, obj)) throw object_not_persistent (); @@ -48,7 +48,7 @@ namespace odb template <typename T> typename object_traits<T>::pointer_type database:: - find (typename object_traits<T>::id_type const& id) + find (const typename object_traits<T>::id_type& id) { if (!transaction::has_current ()) throw not_in_transaction (); @@ -58,7 +58,7 @@ namespace odb template <typename T> bool database:: - find (typename object_traits<T>::id_type const& id, T& obj) + find (const typename object_traits<T>::id_type& id, T& obj) { if (!transaction::has_current ()) throw not_in_transaction (); @@ -85,7 +85,7 @@ namespace odb template <typename T> void database:: - erase (typename object_traits<T>::id_type const& id) + erase (const typename object_traits<T>::id_type& id) { if (!transaction::has_current ()) throw not_in_transaction (); diff --git a/odb/exception.cxx b/odb/exception.cxx index 52d8370..330e70a 100644 --- a/odb/exception.cxx +++ b/odb/exception.cxx @@ -9,7 +9,7 @@ namespace odb { - char const* exception:: + const char* exception:: what () const throw () { return typeid (*this).name (); diff --git a/odb/exception.hxx b/odb/exception.hxx index ff3fc63..c8e2f35 100644 --- a/odb/exception.hxx +++ b/odb/exception.hxx @@ -14,7 +14,7 @@ namespace odb { // By default return the exception type name ( typeid (*this).name () ). // - virtual char const* + virtual const char* what () const throw (); }; } diff --git a/odb/shared-ptr.hxx b/odb/shared-ptr.hxx index 7290a00..f6096f7 100644 --- a/odb/shared-ptr.hxx +++ b/odb/shared-ptr.hxx @@ -28,7 +28,7 @@ namespace odb { } - shared_ptr (shared_ptr const& x) + shared_ptr (const shared_ptr& x) : base (x), x_ (x.x_) { if (x_ != 0) @@ -36,7 +36,7 @@ namespace odb } template <typename Y> - shared_ptr (shared_ptr<Y> const& x) + shared_ptr (const shared_ptr<Y>& x) : base (x), x_ (x.x_) { if (x_ != 0) @@ -44,7 +44,7 @@ namespace odb } shared_ptr& - operator= (shared_ptr const& x) + operator= (const shared_ptr& x) { if (x_ != x.x_) { @@ -63,7 +63,7 @@ namespace odb template <typename Y> shared_ptr& - operator= (shared_ptr<Y> const& x) + operator= (const shared_ptr<Y>& x) { if (x_ != x.x_) { diff --git a/odb/shared-ptr/base.cxx b/odb/shared-ptr/base.cxx index 11fa1c2..56fc32c 100644 --- a/odb/shared-ptr/base.cxx +++ b/odb/shared-ptr/base.cxx @@ -16,7 +16,7 @@ odb::share exclusive = odb::share (2); // namespace odb { - char const* not_shared:: + const char* not_shared:: what () const throw () { return "object is not shared"; diff --git a/odb/shared-ptr/base.hxx b/odb/shared-ptr/base.hxx index 8c1b62b..6fdc32e 100644 --- a/odb/shared-ptr/base.hxx +++ b/odb/shared-ptr/base.hxx @@ -39,16 +39,16 @@ namespace odb { struct not_shared: exception { - virtual char const* + virtual const char* what () const throw (); }; struct shared_base { shared_base (); - shared_base (shared_base const&); + shared_base (const shared_base&); shared_base& - operator= (shared_base const&); + operator= (const shared_base&); void _inc_ref (); @@ -82,7 +82,7 @@ namespace odb template <typename X> inline std::size_t - ref_count (X const*); + ref_count (const X*); } #include <odb/shared-ptr/base.ixx> diff --git a/odb/shared-ptr/base.ixx b/odb/shared-ptr/base.ixx index 992e156..ee27fbe 100644 --- a/odb/shared-ptr/base.ixx +++ b/odb/shared-ptr/base.ixx @@ -30,13 +30,13 @@ namespace odb } inline shared_base:: - shared_base (shared_base const&) + shared_base (const shared_base&) : counter_ (1) { } inline shared_base& shared_base:: - operator= (shared_base const&) + operator= (const shared_base&) { return *this; } diff --git a/odb/shared-ptr/base.txx b/odb/shared-ptr/base.txx index 0f823f8..5cf85f3 100644 --- a/odb/shared-ptr/base.txx +++ b/odb/shared-ptr/base.txx @@ -49,7 +49,7 @@ namespace odb template <typename X> std::size_t* - counter (X const* p) + counter (const X* p) { return bits::locator<X>::counter (const_cast<X*> (p)); } @@ -81,14 +81,14 @@ namespace odb template <typename X> struct counter_ops<X, X> { - counter_ops (X const* p) : counter_ (p ? bits::counter (p) : 0) {} - counter_ops (counter_ops const& x) : counter_ (x.counter_) {} + counter_ops (const X* p) : counter_ (p ? bits::counter (p) : 0) {} + counter_ops (const counter_ops& x) : counter_ (x.counter_) {} template <typename Z> - counter_ops (counter_ops<Z, Z> const& x) : counter_ (x.counter_) {} + counter_ops (const counter_ops<Z, Z>& x) : counter_ (x.counter_) {} counter_ops& - operator= (counter_ops const& x) + operator= (const counter_ops& x) { counter_ = x.counter_; return *this; @@ -96,14 +96,14 @@ namespace odb template <typename Z> counter_ops& - operator= (counter_ops<Z, Z> const& x) + operator= (const counter_ops<Z, Z>& x) { counter_ = x.counter_; return *this; } void - reset (X const* p) + reset (const X* p) { counter_ = p ? bits::counter (p) : 0; } @@ -125,7 +125,7 @@ namespace odb } std::size_t - count (X const*) const + count (const X*) const { return *counter_; } @@ -136,27 +136,27 @@ namespace odb template <typename Y> struct counter_ops<shared_base, Y> { - counter_ops (Y const*) {} - counter_ops (counter_ops const&) {} + counter_ops (const Y*) {} + counter_ops (const counter_ops&) {} template <typename Z> - counter_ops (counter_ops<shared_base, Z> const&) {} + counter_ops (const counter_ops<shared_base, Z>&) {} counter_ops& - operator= (counter_ops const&) + operator= (const counter_ops&) { return *this; } template <typename Z> counter_ops& - operator= (counter_ops<shared_base, Z> const&) + operator= (const counter_ops<shared_base, Z>&) { return *this; } void - reset (Y const*) {} + reset (const Y*) {} void inc (shared_base* p) {p->_inc_ref ();} @@ -169,7 +169,7 @@ namespace odb } std::size_t - count (shared_base const* p) const {return p->_ref_count ();} + count (const shared_base* p) const {return p->_ref_count ();} }; } @@ -192,7 +192,7 @@ namespace odb template <typename X> inline std::size_t - ref_count (X const* p) + ref_count (const X* p) { bits::counter_ops<typename bits::counter_type<X>::r, X> c (p); return c.count (p); |