AbstractEntityWrapper.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package MemoryX::Core
17 * @author ALexey Kozlov ( kozlov at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <MemoryX/interface/core/EntityBase.h>
26 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
27 #include <memory>
28 
29 namespace memoryx
30 {
31  class GridFileManager;
32  using GridFileManagerPtr = std::shared_ptr<GridFileManager>;
33 }
34 
36 {
37 
48  public AbstractEntityWrapperBase
49  {
50  public:
52  ~AbstractEntityWrapper() override;
53 
57  std::string getId() const;
58 
62  std::string getName() const;
63 
67  EntityBasePtr getEntity() const;
68 
74  // void setEntity(EntityBase* entity);
75  void setEntity(const EntityBasePtr& entity);
76  private:
77  EntityBasePtr entity;
78  };
79 
80 
81 
84  {
85  public:
87  protected:
98  void cleanUpAttributeFiles(EntityAttributeBasePtr oldAttr, EntityAttributeBasePtr newAttr);
103  void removeAttributeFiles(const memoryx::EntityAttributeBasePtr& attr);
104  std::string cacheAttributeFile(const std::string& attrName, bool preserveOriginalFName = false) const;
105 
107  };
108 
113 
114 }
memoryx::EntityWrappers::AbstractFileEntityWrapper::removeAttributeFiles
void removeAttributeFiles(const memoryx::EntityAttributeBasePtr &attr)
removes all files of an attribute from the gridfs
Definition: AbstractEntityWrapper.cpp:102
memoryx::EntityWrappers::AbstractFileEntityWrapper::cleanUpAttributeFiles
void cleanUpAttributeFiles(EntityAttributeBasePtr oldAttr, EntityAttributeBasePtr newAttr)
cleanUpAttributeFiles compares the files attached to the two given attributes and removes the files o...
Definition: AbstractEntityWrapper.cpp:64
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::EntityWrappers::AbstractEntityWrapper::getEntity
EntityBasePtr getEntity() const
Get the stored name of the stored entity.
Definition: AbstractEntityWrapper.cpp:49
memoryx::EntityWrappers::AbstractEntityWrapper::AbstractEntityWrapper
AbstractEntityWrapper()
Definition: AbstractEntityWrapper.cpp:30
memoryx::EntityWrappers::AbstractEntityWrapper
AbstractEntityWrapper is a superclass for all covenience classes, which provide typed access to entit...
Definition: AbstractEntityWrapper.h:47
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::EntityWrappers::AbstractEntityWrapper::~AbstractEntityWrapper
~AbstractEntityWrapper() override
Definition: AbstractEntityWrapper.cpp:35
memoryx::EntityWrappers::AbstractFileEntityWrapper
Definition: AbstractEntityWrapper.h:82
memoryx::EntityWrappers::AbstractEntityWrapper::getName
std::string getName() const
Get the name of the stored entity.
Definition: AbstractEntityWrapper.cpp:44
memoryx::EntityWrappers::AbstractFileEntityWrapper::cacheAttributeFile
std::string cacheAttributeFile(const std::string &attrName, bool preserveOriginalFName=false) const
Definition: AbstractEntityWrapper.cpp:129
memoryx::EntityWrappers
Definition: AbstractEntityWrapper.cpp:28
memoryx::EntityWrappers::AbstractEntityWrapper::setEntity
void setEntity(const EntityBasePtr &entity)
Replace the stored entity with a new one.
Definition: AbstractEntityWrapper.cpp:54
memoryx::GridFileManagerPtr
std::shared_ptr< GridFileManager > GridFileManagerPtr
Definition: AbstractEntityWrapper.h:32
memoryx::EntityWrappers::AbstractEntityWrapper::getId
std::string getId() const
Get the identifier of the stored entity.
Definition: AbstractEntityWrapper.cpp:39
memoryx::EntityWrappers::AbstractFileEntityWrapper::AbstractFileEntityWrapper
AbstractFileEntityWrapper(GridFileManagerPtr fileManager)
Definition: AbstractEntityWrapper.cpp:142
memoryx::EntityWrappers::AbstractFileEntityWrapper::fileManager
GridFileManagerPtr fileManager
Definition: AbstractEntityWrapper.h:106