60 if (objects.contains(objID))
62 if (objects.value(objID).contains(obj->
getInstID()))
73 if (objects.value(objID).last()->getInstID() < obj->
getInstID())
78 for (quint32 instidx = objects.value(objID).last()->getInstID() + 1;
82 QMap<quint32, UAVObject *> ppp;
83 ppp.insert(instidx, cobj);
84 objects[objID].insert(instidx, cobj);
89 obj->
initialize(objects.value(objID).last()->getObjID() + 1, mobj);
94 objects[objID].insert(obj->
getInstID(), obj);
104 QString mname = obj->
getName();
105 mname.append(
"Meta");
128 quint32 instances = (quint32)objects.value(obj->
getObjID()).count();
129 for (quint32
x = obj->
getInstID();
x < instances; ++
x) {
130 getObject(objects.value(objID).value(
x)->getObjID())
131 ->emitInstanceRemoved(objects.value(objID).value(
x));
133 objects[objID].remove(
x);
138 void UAVObjectManager::addObject(
UAVObject *obj)
141 QMap<quint32, UAVObject *> list;
143 objects.insert(obj->
getObjID(), list);
145 objectsByName.insert(obj->
getName(), list);
156 QVector<QVector<UAVObject *>> vector;
157 foreach (
const ObjectMap &map, objects.values()) {
158 QVector<UAVObject *> vec = map.values().toVector();
174 QVector<QVector<UAVDataObject *>> vector;
175 foreach (
const ObjectMap &map, objects.values()) {
178 QVector<UAVDataObject *> vec;
195 QVector<QVector<UAVMetaObject *>> vector;
196 foreach (
const ObjectMap &map, objects.values()) {
199 QVector<UAVMetaObject *> vec;
235 if (objectsByName.contains(name)) {
236 return objectsByName.value(name).value(instId);
240 }
else if (objects.contains(objId))
241 return objects.value(objId).value(instId);
267 foreach (
const ObjectMap &map, objects) {
268 if (map.first()->getName().compare(name) == 0)
269 return map.values().toVector();
271 }
else if (objects.contains(objId))
272 return objects.value(objId).values().toVector();
273 return QVector<UAVObject *>();
298 foreach (
const ObjectMap &map, objects) {
299 if (map.first()->getName().compare(name) == 0)
302 }
else if (objects.contains(objId))
303 return objects.value(objId).count();
QVector< UAVObject * > getObjectInstancesVector(const QString &name)
QVector< QVector< UAVMetaObject * > > getMetaObjectsVector()
void initialize(quint32 instID, UAVMetaObject *mobj)
QMap< quint32, UAVObject * > ObjectMap
QVector< QVector< UAVObject * > > getObjectsVector()
bool registerObject(UAVDataObject *obj)
void instanceRemoved(UAVObject *obj)
void newInstance(UAVObject *obj)
UAVMetaObject * getMetaObject()
UAVObjectField * getField(const QString &name)
QHash< quint32, QMap< quint32, UAVObject * > > getObjects()
void emitNewInstance(UAVObject *)
virtual UAVDataObject * clone(quint32 instID=0)=0
UAVObject * getObject(const QString &name, quint32 instId=0)
UAVObjectField * getField(const QString &objName, const QString &fieldName, quint32 instId=0)
getField Get a UAV Object field Success is asserted so there is no need to do this again in the calle...
QVector< QVector< UAVDataObject * > > getDataObjectsVector()
bool unRegisterObject(UAVDataObject *obj)
unregisters an object instance and all instances bigger than the one passed as argument from the mana...
qint32 getNumInstances(const QString &name)
void newObject(UAVObject *obj)