summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/kernel/fstream.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-07-16 06:48:11 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-07-16 06:48:11 +0000
commit574ccee478b9da9457cdf0e476b8df6eb584b580 (patch)
tree5a8166f47057ed322294db7816e2732d1d18f7bc /sca-cpp/trunk/kernel/fstream.hpp
parent419f903ff44a22debba43976baae1e86c1e5d871 (diff)
Minor memory management, performance, and tracing improvements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1361917 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/kernel/fstream.hpp')
-rw-r--r--sca-cpp/trunk/kernel/fstream.hpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/sca-cpp/trunk/kernel/fstream.hpp b/sca-cpp/trunk/kernel/fstream.hpp
index 5ea9df2d62..4f7f5152aa 100644
--- a/sca-cpp/trunk/kernel/fstream.hpp
+++ b/sca-cpp/trunk/kernel/fstream.hpp
@@ -78,6 +78,14 @@ public:
ofstream(const ofstream& os) : file(os.file), owner(false) {
}
+ const ofstream& operator=(const ofstream& os) {
+ if(this == &os)
+ return *this;
+ file = os.file;
+ owner = false;
+ return *this;
+ }
+
~ofstream() {
if (!owner)
return;
@@ -127,6 +135,14 @@ public:
ifstream(const ifstream& is) : file(is.file), owner(false) {
}
+ const ifstream& operator=(const ifstream& is) {
+ if(this == &is)
+ return *this;
+ file = is.file;
+ owner = false;
+ return *this;
+ }
+
~ifstream() {
if (!owner)
return;
@@ -351,7 +367,7 @@ const bool debug_isLogging() {
* Log a debug message.
*/
const bool debugLog(const string& msg) {
- gc_scoped_pool();
+ gc_scoped_pool p;
cdebug << msg << endl;
return true;
}
@@ -360,7 +376,7 @@ const bool debugLog(const string& msg) {
* Log a debug message and a value.
*/
template<typename V> const bool debugLog(const V& v, const string& msg) {
- gc_scoped_pool();
+ gc_scoped_pool p;
cdebug << msg << ": " << v << endl;
return true;
}
@@ -369,7 +385,7 @@ template<typename V> const bool debugLog(const V& v, const string& msg) {
* Log a debug message and two values.
*/
template<typename V, typename W> const bool debugLog(const V& v, const W& w, const string& msg) {
- gc_scoped_pool();
+ gc_scoped_pool p;
cdebug << msg << ": " << v << " : " << w << endl;
return true;
}