From 2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 8 Dec 2020 22:26:17 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro (cherry picked from commit fce86b22a2367f1be1f9aae5e1ba3d18d1371b74) --- arts/modules/common/env_container_impl.cc | 136 ------------------------------ 1 file changed, 136 deletions(-) delete mode 100644 arts/modules/common/env_container_impl.cc (limited to 'arts/modules/common/env_container_impl.cc') diff --git a/arts/modules/common/env_container_impl.cc b/arts/modules/common/env_container_impl.cc deleted file mode 100644 index 0a6f87d7..00000000 --- a/arts/modules/common/env_container_impl.cc +++ /dev/null @@ -1,136 +0,0 @@ -#include "artsmodulescommon.h" -#include "../runtime/sequenceutils.h" -#include - -using namespace std; - -namespace Arts { -namespace Environment { - -class Container_impl : virtual public Container_skel { -protected: - string _dataDirectory; - Context _context; - vector _items; - - Container self() { return Container::_from_base(_copy()); } -public: - ~Container_impl() - { - // tell items we're going to leave before actually going away - clear(); - } - string dataDirectory() - { - return _dataDirectory; - } - void dataDirectory(const string& newDataDirectory) - { - if(newDataDirectory != _dataDirectory) - { - _dataDirectory = newDataDirectory; - dataDirectory_changed(newDataDirectory); - } - } - Context context() - { - return _context; - } - void context(Context newContext) - { - _context = newContext; - } - vector *items() - { - return new vector(_items); - } - vector *saveToList() - { - vector *result = new vector; - - vector::iterator ii; - for(ii=_items.begin(); ii != _items.end(); ii++) - { - sqprintf(result,"item=%s",ii->_interfaceName().c_str()); - - vector *itemresult = ii->saveToList(); - addSubStringSeq(result,itemresult); - delete itemresult; - } - return result; - } - - void clear() - { - /* FIXME: performance ;) */ - while(!_items.empty()) - removeItem(_items.front()); - } - - void loadFromList(const vector& strlist) - { - string cmd,param; - unsigned long i; - - clear(); - - for(i=0;i *itemlist = getSubStringSeq(&strlist,i); - - if(!item.isNull()) - item.loadFromList(*itemlist); - else - { - // error handling - assert(false); - } - delete itemlist; - } - } - } - } - - vector::iterator findItem(Item item) - { - vector::iterator i; - for(i = _items.begin(); i != _items.end(); i++) - if(i->_isEqual(item)) return i; - - return _items.end(); - } - - void addItem(Item item) - { - vector::iterator i = findItem(item); - arts_return_if_fail(i == _items.end()); - - _items.push_back(item); - item.setContainer(self()); - } - - Item createItem(const string& name) - { - Item item = SubClass(name); - addItem(item); - return item; - } - - void removeItem(Item item) - { - vector::iterator i = findItem(item); - arts_return_if_fail(i != _items.end()); - - _items.erase(i); - item.setContainer(Container::null()); - } -}; -REGISTER_IMPLEMENTATION(Container_impl); -} -} - -- cgit v1.2.1