You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/04/20 21:21:01 UTC

[44/50] [abbrv] git commit: [TS-2664] Removing initializable value files

[TS-2664] Removing initializable value files


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

Branch: refs/heads/lua_config
Commit: 53431324ddc54ede890d3a7274648057b6cabfaf
Parents: 70599ab
Author: Brian Geffon <br...@apache.org>
Authored: Tue Mar 25 14:18:19 2014 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Tue Mar 25 14:18:19 2014 -0700

----------------------------------------------------------------------
 lib/atscppapi/src/InitializableValue.cc        | 29 -------
 lib/atscppapi/src/include/InitializableValue.h | 90 ---------------------
 2 files changed, 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/53431324/lib/atscppapi/src/InitializableValue.cc
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/InitializableValue.cc b/lib/atscppapi/src/InitializableValue.cc
deleted file mode 100644
index a0d87af..0000000
--- a/lib/atscppapi/src/InitializableValue.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/**
- * @file InitializableValue.cc
- */
-
-#include "InitializableValue.h"
-
-#ifdef DISABLE_TRANSACTION_DATA_CACHING
-bool atscppapi::transaction_data_caching_enabled = false;
-#else
-bool atscppapi::transaction_data_caching_enabled = true;
-#endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/53431324/lib/atscppapi/src/include/InitializableValue.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/InitializableValue.h b/lib/atscppapi/src/include/InitializableValue.h
deleted file mode 100644
index 8d20320..0000000
--- a/lib/atscppapi/src/include/InitializableValue.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/**
- * @file InitializableValue.h
- */
-
-#pragma once
-#ifndef ATSCPPAPI_INITIALIZABLEVALUE_H_
-#define ATSCPPAPI_INITIALIZABLEVALUE_H_
-
-namespace atscppapi {
-
-// cannot be static as InitializableValue is a template and a static
-// member of that would be instantiated once for every type the
-// template is instantiated
-extern bool transaction_data_caching_enabled;
-
-/**
- * @private
- */
-template <typename Type> class InitializableValue {
-public:
-  InitializableValue() : initialized_(false) { }
-  explicit InitializableValue(Type value, bool initialized = true) : value_(value), initialized_(initialized) { }
-
-  inline void setValue(const Type &value) {
-    value_ = value;
-    initialized_ = true;
-  }
-
-  inline bool isInitialized() const {
-#ifdef DISABLE_TRANSACTION_DATA_CACHING
-    return false;
-#endif
-    return transaction_data_caching_enabled && initialized_;
-  }
-
-  inline Type &getValueRef() {
-    return value_;
-  }
-
-  inline Type getValue() {
-    return value_;
-  }
-
-  inline const Type &getValueRef() const {
-    return value_;
-  }
-
-  inline void setInitialized(bool initialized = true) {
-    initialized_ = initialized;
-  }
-
-  inline operator Type&() {
-    return value_;
-  }
-
-  inline operator const Type&() const {
-    return value_;
-  }
-
-  inline InitializableValue<Type> &operator=(const Type& value) {
-    setValue(value);
-    return *this;
-  }
-
-private:
-  Type value_;
-  bool initialized_;
-};
-
-}
-
-#endif /* ATSCPPAPI_INITIALIZABLEVALUE_H_ */