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>
14#include "IVisualisationTable.h"
15#include "ClassFactory.h"
16
17
19{
20public:
21 friend class FixtureEntityBuffer;
22 static EntityBuffer& instance();
23
24 void setModelServiceAPI(ot::ModelServiceAPI* _modelServiceAPI);
25
26 PyObject* getEntityPropertyValue(const std::string& _absoluteEntityName, const std::string& _propertyName);
27 PyObject* getTableCellValue(const std::string& _absoluteEntityName, uint32_t _row, uint32_t _column);
28 void updateEntityPropertyValue(const std::string& _absoluteEntityName, const std::string& _propertyName, const CPythonObject& _values);
29 std::shared_ptr<EntityBase> getEntity(const std::string& _absoluteEntityName);
30
32 bool saveChangedEntities(const std::string& _absoluteEntityName);
33
34 void clearBuffer();
35
36private:
38
39 std::map<std::string, std::shared_ptr<EntityBase>> m_bufferedEntities;
40 std::map<std::string, IVisualisationTable*> m_bufferedTableEntities;
41 std::map<std::string, EntityPropertiesBase*> m_bufferedEntityProperties;
42
43 ot::ModelServiceAPI* m_modelServiceAPI;
44
45 void ensurePropertyToBeLoaded(const std::string& _absoluteEntityName, const std::string& _propertyName);
46 void ensureTableToBeLoaded(const std::string& _absoluteEntityName);
47 void ensureValidRangeSelections(EntityBase* _entityBase);
48
49 std::shared_ptr<EntityBase> loadEntity(const std::string& _absoluteEntityName);
50};
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:19
static EntityBuffer & instance()
Definition EntityBuffer.cpp:10
std::shared_ptr< EntityBase > getEntity(const std::string &_absoluteEntityName)
Definition EntityBuffer.cpp:101
void clearBuffer()
Definition EntityBuffer.cpp:254
PyObject * getEntityPropertyValue(const std::string &_absoluteEntityName, const std::string &_propertyName)
Definition EntityBuffer.cpp:20
void setModelServiceAPI(ot::ModelServiceAPI *_modelServiceAPI)
Definition EntityBuffer.cpp:15
void saveChangedEntities()
Definition EntityBuffer.cpp:59
PyObject * getTableCellValue(const std::string &_absoluteEntityName, uint32_t _row, uint32_t _column)
Definition EntityBuffer.cpp:27
void updateEntityPropertyValue(const std::string &_absoluteEntityName, const std::string &_propertyName, const CPythonObject &_values)
Definition EntityBuffer.cpp:52
friend class FixtureEntityBuffer
Definition EntityBuffer.h:21
Definition ModelServiceAPI.h:12