summaryrefslogtreecommitdiffstats
path: root/arts/modules/common/env_item_impl.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:49:18 +0900
commit2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d (patch)
tree50b6e05734cd5c0f642eeac4e841539db25f113b /arts/modules/common/env_item_impl.cpp
parent6f9d8ae25c3ff607e0e07315884c967dd0bca901 (diff)
downloadtdemultimedia-2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d.tar.gz
tdemultimedia-2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit fce86b22a2367f1be1f9aae5e1ba3d18d1371b74)
Diffstat (limited to 'arts/modules/common/env_item_impl.cpp')
-rw-r--r--arts/modules/common/env_item_impl.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/arts/modules/common/env_item_impl.cpp b/arts/modules/common/env_item_impl.cpp
new file mode 100644
index 00000000..6bc960d8
--- /dev/null
+++ b/arts/modules/common/env_item_impl.cpp
@@ -0,0 +1,48 @@
+#include "artsmodulescommon.h"
+#include "debug.h"
+#include "env_item_impl.h"
+
+using namespace Arts;
+using namespace std;
+
+Environment::Item_impl::Item_impl()
+ : _active(false)
+{
+}
+
+Environment::Item_impl::~Item_impl()
+{
+ // Items can't be deleted while they are still inside a Container
+ arts_assert(_active == false);
+}
+
+Environment::Container Environment::Item_impl::parent()
+{
+ Container p = _parent;
+ return p;
+}
+
+void Environment::Item_impl::setContainer(Environment::Container container)
+{
+ if(container.isNull()) // remove from container
+ {
+ arts_return_if_fail(_active == true);
+
+ _parent = container;
+ _active = false;
+ }
+ else // add to container
+ {
+ Container p = _parent;
+ arts_return_if_fail(p.isNull() && _active == false);
+
+ _parent = container;
+ _active = true;
+ }
+ active_changed(_active);
+}
+
+bool Environment::Item_impl::active()
+{
+ return _active;
+}