Author: hwright
Date: Mon Oct 4 20:51:21 2010
New Revision: 1004422
URL: http://svn.apache.org/viewvc?rev=1004422&view=rev
Log:
On the object-model branch:
Move private bits of classes to the end of the class definition, per our
chosen style.
Suggested by: blair
* subversion/bindings/c++/include/Pool.h,
subversion/bindings/c++/include/Client.h,
subversion/bindings/c++/include/Revision.h,
subversion/bindings/c++/include/Types.h,
subversion/bindings/c++/include/Version.h,
subversion/bindings/c++/include/Common.h:
As above.
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Client.h
subversion/branches/object-model/subversion/bindings/c++/include/Common.h
subversion/branches/object-model/subversion/bindings/c++/include/Pool.h
subversion/branches/object-model/subversion/bindings/c++/include/Revision.h
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
subversion/branches/object-model/subversion/bindings/c++/include/Version.h
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Client.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Client.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Client.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Client.h
Mon Oct 4 20:51:21 2010
@@ -46,17 +46,6 @@ namespace SVN
class Client
{
- private:
- Pool m_pool;
- svn_client_ctx_t *m_ctx;
-
- std::set<Callback::ClientNotifier *> m_notifiers;
-
- static void notify_func2(void *baton,
- const svn_wc_notify_t *notify,
- apr_pool_t *pool);
- void notify(const ClientNotifyInfo &info);
-
public:
/** The constructor. */
Client();
@@ -106,6 +95,17 @@ namespace SVN
const std::vector<std::string> &changelists,
const PropTable &revprop_table,
Callback::Commit &callback);
+
+ private:
+ Pool m_pool;
+ svn_client_ctx_t *m_ctx;
+
+ std::set<Callback::ClientNotifier *> m_notifiers;
+
+ static void notify_func2(void *baton,
+ const svn_wc_notify_t *notify,
+ apr_pool_t *pool);
+ void notify(const ClientNotifyInfo &info);
};
}
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Common.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Common.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Common.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Common.h
Mon Oct 4 20:51:21 2010
@@ -35,15 +35,6 @@ namespace SVN
class Exception : public std::exception
{
- private:
- void assembleErrorMessage(svn_error_t *err, int depth,
- apr_status_t parent_apr_err,
- std::string &buffer);
-
- std::string m_description;
- std::string m_source;
- int m_apr_err;
-
public:
/** A constructor to build an exception from a Subversion error. The
Exception object will ensure the error is cleared. */
@@ -60,6 +51,15 @@ class Exception : public std::exception
int getAPRErr();
svn_error_t *c_err();
+
+ private:
+ void assembleErrorMessage(svn_error_t *err, int depth,
+ apr_status_t parent_apr_err,
+ std::string &buffer);
+
+ std::string m_description;
+ std::string m_source;
+ int m_apr_err;
};
}
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Pool.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Pool.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Pool.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Pool.h Mon
Oct 4 20:51:21 2010
@@ -42,22 +42,6 @@ namespace SVN
*/
class Pool
{
-
- private:
- /** The pool request pool. */
- apr_pool_t *m_pool;
-
- /**
- * We declare the copy constructor and assignment operator private
- * here, so that the compiler won't inadvertently use them for us.
- * The default copy constructor just copies all the data members,
- * which would create two pointers to the same pool, one of which
- * would get destroyed while the other thought it was still
- * valid...and BOOM! Hence the private declaration.
- */
- Pool &operator=(const Pool &that);
- Pool(const Pool &that);
-
public:
Pool();
@@ -91,6 +75,21 @@ namespace SVN
{
svn_pool_clear(m_pool);
}
+
+ private:
+ /** The pool request pool. */
+ apr_pool_t *m_pool;
+
+ /**
+ * We declare the copy constructor and assignment operator private
+ * here, so that the compiler won't inadvertently use them for us.
+ * The default copy constructor just copies all the data members,
+ * which would create two pointers to the same pool, one of which
+ * would get destroyed while the other thought it was still
+ * valid...and BOOM! Hence the private declaration.
+ */
+ Pool &operator=(const Pool &that);
+ Pool(const Pool &that);
};
}
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Revision.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Revision.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Revision.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Revision.h
Mon Oct 4 20:51:21 2010
@@ -36,13 +36,6 @@ namespace SVN
class Revision
{
- private:
- /** The constructors. */
- Revision(svn_opt_revision_kind kind);
- Revision(apr_time_t date, bool foo);
-
- svn_opt_revision_t m_revision;
-
public:
Revision(svn_revnum_t revnum);
@@ -63,6 +56,13 @@ namespace SVN
const static Revision BASE;
const static Revision WORKING;
const static Revision UNSPECIFIED;
+
+ private:
+ /** The constructors. */
+ Revision(svn_opt_revision_kind kind);
+ Revision(apr_time_t date, bool foo);
+
+ svn_opt_revision_t m_revision;
};
}
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Mon Oct 4 20:51:21 2010
@@ -51,11 +51,6 @@ namespace Private
template<typename C, typename T>
class RefCounter
{
- private:
- Pool m_pool;
- size_t count;
- T *p;
-
public:
inline
RefCounter<C, T>(T *in)
@@ -71,14 +66,16 @@ class RefCounter
inline size_t refs() { return count; }
// The default destructor will destroy the Pool, and deallocate our object
+
+ private:
+ Pool m_pool;
+ size_t count;
+ T *p;
};
template<typename C, typename T>
class CStructWrapper
{
- private:
- RefCounter<C, T> *m_data;
-
public:
inline
CStructWrapper(T *data)
@@ -118,6 +115,9 @@ class CStructWrapper
inline const T& operator* () const { return *m_data->ptr(); }
inline const T* operator-> () const { return m_data->ptr(); }
+
+ private:
+ RefCounter<C, T> *m_data;
};
} // namespace Private
@@ -125,9 +125,6 @@ class CStructWrapper
// C-struct wrapper classes
class CommitInfo
{
- private:
- Private::CStructWrapper<CommitInfo, const svn_commit_info_t> m_info;
-
public:
inline static svn_commit_info_t *
dup(const svn_commit_info_t *info, Pool &pool)
@@ -170,13 +167,13 @@ class CommitInfo
else
return std::string();
}
+
+ private:
+ Private::CStructWrapper<CommitInfo, const svn_commit_info_t> m_info;
};
class Lock
{
- private:
- Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
-
public:
inline static svn_lock_t *
dup(const svn_lock_t *lock, Pool &pool)
@@ -231,14 +228,13 @@ class Lock
{
return m_lock->expiration_date;
}
+
+ private:
+ Private::CStructWrapper<Lock, const svn_lock_t> m_lock;
};
class ClientNotifyInfo
{
- private:
- Pool m_pool;
- svn_wc_notify_t *m_notify;
-
public:
inline
ClientNotifyInfo(const svn_wc_notify_t *info)
@@ -266,6 +262,10 @@ class ClientNotifyInfo
{
return m_notify;
}
+
+ private:
+ Pool m_pool;
+ svn_wc_notify_t *m_notify;
};
}
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Version.h
URL:
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Version.h?rev=1004422&r1=1004421&r2=1004422&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Version.h
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Version.h
Mon Oct 4 20:51:21 2010
@@ -36,13 +36,6 @@ namespace SVN
class Version
{
- private:
- int m_major;
- int m_minor;
- int m_patch;
-
- std::string m_tag;
-
public:
/** The constructor. */
Version(const svn_version_t *);
@@ -52,6 +45,13 @@ namespace SVN
/** The destructor needs to be public. */
virtual ~Version();
+
+ private:
+ int m_major;
+ int m_minor;
+ int m_patch;
+
+ std::string m_tag;
};
}