OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityBuffer.h
Go to the documentation of this file.
1/*****************************************************************/
8#pragma once
9#include "CPythonObjectNew.h"
10#include "EntityBase.h"
11#include <string>
12#include <memory>
13#include "IVisualisationTable.h"
14#include "ClassFactory.h"
15
17{
18public:
19 friend class FixtureEntityBuffer;
20 static EntityBuffer& instance();
21
22 PyObject* getEntityPropertyValue(const std::string& _absoluteEntityName, const std::string& _propertyName);
23 PyObject* getTableCellValue(const std::string& _absoluteEntityName, uint32_t _row, uint32_t _column);
24 void updateEntityPropertyValue(const std::string& _absoluteEntityName, const std::string& _propertyName, const CPythonObject& _values);
25 std::shared_ptr<EntityBase> getEntity(const std::string& _absoluteEntityName);
26
28 bool saveChangedEntities(const std::string& _absoluteEntityName);
29
30 void clearBuffer();
31
32private:
34
35 std::map<std::string, std::shared_ptr<EntityBase>> m_bufferedEntities;
36 std::map<std::string, IVisualisationTable*> m_bufferedTableEntities;
37 std::map<std::string, EntityPropertiesBase*> m_bufferedEntityProperties;
38
39 void ensurePropertyToBeLoaded(const std::string& _absoluteEntityName, const std::string& _propertyName);
40 void ensureTableToBeLoaded(const std::string& _absoluteEntityName);
41 void ensureValidRangeSelections(EntityBase* _entityBase);
42
43 std::shared_ptr<EntityBase> loadEntity(const std::string& _absoluteEntityName);
44};
Wrapper around a PyObject* that is a new reference. This owns the reference so does not increment it ...
Definition CPythonObject.h:13
Definition EntityBuffer.h:17
static EntityBuffer & instance()
Definition EntityBuffer.cpp:11
std::shared_ptr< EntityBase > getEntity(const std::string &_absoluteEntityName)
Definition EntityBuffer.cpp:97
void clearBuffer()
Definition EntityBuffer.cpp:250
PyObject * getEntityPropertyValue(const std::string &_absoluteEntityName, const std::string &_propertyName)
Definition EntityBuffer.cpp:16
void saveChangedEntities()
Definition EntityBuffer.cpp:55
PyObject * getTableCellValue(const std::string &_absoluteEntityName, uint32_t _row, uint32_t _column)
Definition EntityBuffer.cpp:23
void updateEntityPropertyValue(const std::string &_absoluteEntityName, const std::string &_propertyName, const CPythonObject &_values)
Definition EntityBuffer.cpp:48
friend class FixtureEntityBuffer
Definition EntityBuffer.h:19