trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhe...@apache.org
Subject [1/2] trafficserver git commit: [TS-3279]: add operator ->() and explicit constructor to ats_scoped_obj
Date Wed, 07 Jan 2015 17:50:35 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master a41b4fe5d -> 175c2644b


[TS-3279]: add operator ->() and explicit constructor to ats_scoped_obj


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a7975ca0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a7975ca0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a7975ca0

Branch: refs/heads/master
Commit: a7975ca026588347a4fb1f53b3e9b02b78722110
Parents: a41b4fe
Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Authored: Wed Jan 7 17:49:39 2015 +0000
Committer: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Committed: Wed Jan 7 17:49:39 2015 +0000

----------------------------------------------------------------------
 lib/ts/ink_memory.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a7975ca0/lib/ts/ink_memory.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_memory.h b/lib/ts/ink_memory.h
index 23da1b9..7a8729b 100644
--- a/lib/ts/ink_memory.h
+++ b/lib/ts/ink_memory.h
@@ -438,10 +438,20 @@ public:
   typedef ats_scoped_resource<detail::SCOPED_OBJECT_TRAITS<T> > super; ///<
Super type.
   typedef ats_scoped_obj self; ///< Self reference.
 
+  /// Default constructor - an empty container.
+  ats_scoped_obj() : super() {}
+
+  /// Construct with contained resource.
+  explicit ats_scoped_obj(T* obj) : super(obj) {}
+
   self& operator = (T* obj) {
     super::operator=(obj);
     return *this;
   }
+
+  T* operator -> () const {
+    return *this;
+  }
 };
 
 /** Combine two strings as file paths.


Mime
View raw message