PersistentEntitySegment.cpp
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 2013
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
24
25#include <iostream>
26
27#include <Ice/ObjectAdapter.h>
28#include <IceUtil/UUID.h>
29
32#include <ArmarXCore/interface/serialization/JSONSerialization.h>
34
35#include "SegmentedMemory.h"
39
40namespace memoryx
41{
42 PersistentEntitySegment::PersistentEntitySegment(CollectionInterfacePrx entityCollection,
44 bool useMongoIds /* = true */) :
46 {
48 setSingleRWCollection(entityCollection);
49 }
50
54
55 NameList
57 {
58 memoryx::NameList result;
59 auto lock = getReadLock(c);
60
61 for (CollectionPrxList::const_iterator it = readCollections.begin();
62 it != readCollections.end();
63 ++it)
64 {
65 if (!*it)
66 {
67 continue;
68 }
69
70 result.push_back((*it)->getNS());
71 }
72
73 return result;
74 }
75
76 void
78 {
79 ARMARX_INFO_S << "Clearing read collections";
80 auto lock = getWriteLock(c);
81 readCollections.clear();
82 }
83
84 void
85 PersistentEntitySegment::addReadCollection(const CollectionInterfacePrx& coll,
86 const ::Ice::Current& c)
87 {
88 if (coll)
89 {
91
92 bool found = false;
93 const std::string newName = coll->getNS();
94
95 for (CollectionPrxList::iterator it = readCollections.begin();
96 it != readCollections.end();
97 it++)
98 {
100
101 if (newName == (*it)->getNS())
102 {
103 found = true;
104 break;
105 }
106 }
107
108 if (!found)
109 {
110 readCollections.push_back(coll);
111 ARMARX_INFO_S << coll->getNS() << " collection added to list";
112 }
113 else
114 {
115 ARMARX_INFO_S << coll->getNS() << " collection already in list";
116 }
117 }
118 }
119
120 std::string
122 {
123 return writeCollection->getNS();
124 }
125
126 void
127 PersistentEntitySegment::setWriteCollection(const CollectionInterfacePrx& coll,
128 const ::Ice::Current& c)
129 {
130 if (coll)
131 {
132 writeCollection = coll;
133 }
134 }
135
136 void
137 PersistentEntitySegment::setSingleRWCollection(const CollectionInterfacePrx& coll,
138 const ::Ice::Current& c)
139 {
140 setWriteCollection(coll);
142 addReadCollection(coll);
143 }
144
145 std::string
146 PersistentEntitySegment::getObjectTypeId(const ::Ice::Current& c) const
147 {
148 return objectTypeId;
149 }
150
151 std::string
152 PersistentEntitySegment::addEntity(const EntityBasePtr& entity, const ::Ice::Current& c)
153 {
155 return addEntityThreadUnsafe(entity);
156 }
157
158 std::string
160 {
161 DBStorableData dbEntity;
162 {
163 std::unique_lock lock(dbSerializerMutex);
164 dbEntity = dbSerializer->serializeIceObject(entity);
165 }
166 return writeCollection->insert(dbEntity);
167 }
168
169 std::string
170 PersistentEntitySegment::upsertEntity(const std::string& entityId,
171 const EntityBasePtr& entity,
172 const Ice::Current& c)
173 {
175 return upsertEntityThreadUnsafe(entityId, entity);
176 }
177
178 std::string
180 const EntityBasePtr& entity)
181 {
182 if (hasEntityByIdThreadUnsafe(entityId))
183 {
184 updateEntityThreadUnsafe(entityId, entity);
185 return entityId;
186 }
187 else
188 {
189 return addEntityThreadUnsafe(entity);
190 }
191 }
192
193 EntityIdList
194 PersistentEntitySegment::upsertEntityList(const EntityBaseList& entityList,
195 const Ice::Current& c)
196 {
198 return upsertEntityListThreadUnsafe(entityList);
199 }
200
201 EntityIdList
203 {
204 EntityIdList entityIds(entityList.size(), "");
205
206 for (size_t i = 0; i < entityList.size(); i++)
207 {
208 try
209 {
210 entityIds[i] = upsertEntityThreadUnsafe(entityList[i]->getId(), entityList[i]);
211 }
212 catch (const memoryx::InvalidEntityException& e)
213 {
214 // don't handle this exception but return an empty string as ID for this specific entity
215 }
216 }
217
218 return entityIds;
219 }
220
221 std::string
222 PersistentEntitySegment::upsertEntityByName(const std::string& entityName,
223 const EntityBasePtr& entity,
224 const Ice::Current& c)
225 {
227 return upsertEntityByNameThreadUnsafe(entityName, entity);
228 }
229
230 std::string
232 const EntityBasePtr& entity)
233 {
234 auto oldEntity = getEntityByNameThreadUnsafe(entityName);
235 if (oldEntity)
236 {
237 updateEntityThreadUnsafe(oldEntity->getId(), entity);
238 return oldEntity->getId();
239 }
240 else
241 {
242 return addEntityThreadUnsafe(entity);
243 }
244 }
245
246 EntityIdList
247 PersistentEntitySegment::addEntityList(const EntityBaseList& entityList, const Ice::Current& c)
248 {
250 return addEntityListThreadUnsafe(entityList);
251 }
252
253 EntityIdList
255 {
256 DBStorableDataList dbEntities;
257 dbEntities.reserve(entityList.size());
258
259 for (size_t i = 0; i < entityList.size(); i++)
260 {
261 std::unique_lock lock(dbSerializerMutex);
262
263 dbEntities.push_back(dbSerializer->serializeIceObject(entityList[i]));
264 }
265
266 return writeCollection->insertList(dbEntities);
267 }
268
269 void
270 PersistentEntitySegment::updateEntity(const ::std::string& entityId,
271 const EntityBasePtr& update,
272 const ::Ice::Current& c)
273 {
275 updateEntityThreadUnsafe(entityId, update);
276 }
277
278 void
280 const EntityBasePtr& update)
281 {
282 update->setId(entityId);
283 DBStorableData dbEntity;
284 {
285 std::unique_lock lock(dbSerializerMutex);
286 dbEntity = dbSerializer->serializeIceObject(update);
287 }
288
289 writeCollection->update(dbEntity);
290 }
291
292 void
293 PersistentEntitySegment::removeEntity(const ::std::string& entityId, const ::Ice::Current& c)
294 {
296 removeEntityThreadUnsafe(entityId);
297 }
298
299 void
301 {
302 if (useMongoIds)
303 {
304 writeCollection->removeByMongoId(entityId);
305 }
306 else
307 {
308 writeCollection->removeByFieldValue("_id", entityId);
309 }
310 }
311
312 void
314 {
316
317 auto ids = getAllEntityIdsThreadUnsafe();
318
319 for (auto& id : ids)
320 {
322 }
323 }
324
325 bool
326 PersistentEntitySegment::hasEntityById(const std::string& entityId, const Ice::Current& c) const
327 {
329 return hasEntityByIdThreadUnsafe(entityId);
330 }
331
332 bool
333 PersistentEntitySegment::hasEntityByIdThreadUnsafe(const std::string& entityId) const
334 {
335 if (entityId.empty() || entityId.size() != 24)
336 {
337 return false;
338 }
339 try
340 {
341 for (CollectionPrxList::const_iterator it = readCollections.begin();
342 it != readCollections.end();
343 ++it)
344 {
345 if (!*it)
346 {
347 continue;
348 }
349
350 const DBStorableData dbEntity = useMongoIds
351 ? (*it)->findByMongoId(entityId)
352 : (*it)->findOneByFieldValue("_id", entityId);
353
354 if (!dbEntity.JSON.empty())
355 {
356 return true;
357 }
358 }
359 }
360 catch (...)
361 {
362 }
363
364 return false;
365 }
366
367 bool
368 PersistentEntitySegment::hasEntityByName(const std::string& entityName,
369 const Ice::Current& c) const
370 {
372 return hasEntityByNameThreadUnsafe(entityName);
373 }
374
375 bool
376 PersistentEntitySegment::hasEntityByNameThreadUnsafe(const std::string& entityName) const
377 {
378 for (CollectionPrxList::const_iterator it = readCollections.begin();
379 it != readCollections.end();
380 ++it)
381 {
382 CollectionInterfacePrx coll = *it;
383
384 if (!coll)
385 {
386 continue;
387 }
388
389 const DBStorableData dbEntity = coll->findOneByFieldValue("name", entityName);
390
391 if (!dbEntity.JSON.empty())
392 {
393 return true;
394 }
395 }
396
397 return false;
398 }
399
400 EntityBasePtr
401 PersistentEntitySegment::getEntityById(const ::std::string& entityId,
402 const ::Ice::Current& c) const
403 {
405
406 return getEntityByIdThreadUnsafe(entityId);
407 }
408
409 EntityBasePtr
410 PersistentEntitySegment::getEntityByIdThreadUnsafe(const std::string& entityId) const
411 {
412 if (entityId.empty())
413 {
414 ARMARX_ERROR_S << "Entity id must not be empty!";
415 return EntityBasePtr();
416 }
417
418
419 for (CollectionPrxList::const_iterator it = readCollections.begin();
420 it != readCollections.end();
421 ++it)
422 {
423 if (!*it)
424 {
425 continue;
426 }
427
428 const DBStorableData dbEntity = useMongoIds
429 ? (*it)->findByMongoId(entityId)
430 : (*it)->findOneByFieldValue("_id", entityId);
431
432 if (!dbEntity.JSON.empty())
433 {
434 return deserializeEntity(dbEntity);
435 }
436 }
437
438 return EntityBasePtr();
439 }
440
441 EntityBasePtr
443 const ::Ice::Current& c) const
444 {
446 return getEntityByNameThreadUnsafe(name);
447 }
448
449 EntityBasePtr
451 {
452 for (CollectionPrxList::const_iterator it = readCollections.begin();
453 it != readCollections.end();
454 ++it)
455 {
456 if (!*it)
457 {
458 continue;
459 }
460
461 const DBStorableData dbEntity = (*it)->findOneByFieldValue("name", name);
462
463 if (!dbEntity.JSON.empty())
464 {
465 return deserializeEntity(dbEntity);
466 }
467 }
468
469 return EntityBasePtr();
470 }
471
472 EntityBaseList
474 const ::std::string& attrValue,
475 const ::Ice::Current& c) const
476 {
477 EntityBaseList result;
478 const std::string fieldName = "attrs." + attrName + ".value.value";
480
481 for (CollectionPrxList::const_iterator itColl = readCollections.begin();
482 itColl != readCollections.end();
483 ++itColl)
484 {
485 if (!*itColl)
486 {
487 continue;
488 }
489
490 const DBStorableDataList dbEntities = (*itColl)->findByFieldValue(fieldName, attrValue);
491
492 for (DBStorableDataList::const_iterator itEntity = dbEntities.begin();
493 itEntity != dbEntities.end();
494 ++itEntity)
495 {
496 EntityBasePtr entity = deserializeEntity(*itEntity);
497
498 if (entity)
499 {
500 result.push_back(entity);
501 }
502 }
503 }
504
505 return result;
506 }
507
508 EntityBaseList
510 const NameList& attrValueList,
511 const ::Ice::Current& c) const
512 {
513 EntityBaseList result;
514 const std::string fieldName = "attrs." + attrName + ".value.value";
516
517 for (CollectionPrxList::const_iterator itColl = readCollections.begin();
518 itColl != readCollections.end();
519 ++itColl)
520 {
521 if (!*itColl)
522 {
523 continue;
524 }
525
526 const DBStorableDataList dbEntities =
527 (*itColl)->findByFieldValueList(fieldName, attrValueList);
528
529 for (DBStorableDataList::const_iterator itEntity = dbEntities.begin();
530 itEntity != dbEntities.end();
531 ++itEntity)
532 {
533 EntityBasePtr entity = deserializeEntity(*itEntity);
534
535 if (entity)
536 {
537 result.push_back(entity);
538 }
539 }
540 }
541
542 return result;
543 }
544
545 Ice::Int
546 PersistentEntitySegment::size(const ::Ice::Current& c) const
547 {
548 Ice::Int result = 0;
550
551 for (CollectionPrxList::const_iterator it = readCollections.begin();
552 it != readCollections.end();
553 ++it)
554 {
555 if (!*it)
556 {
557 continue;
558 }
559
560 result += (*it)->count();
561 }
562
563 return result;
564 }
565
566 void
567 PersistentEntitySegment::print(const ::Ice::Current& c) const
568 {
569 //TODO implement
570 }
571
572 void
573 PersistentEntitySegment::clear(const ::Ice::Current& c)
574 {
575 writeCollection->clear();
576 }
577
578 Ice::Identity
579 PersistentEntitySegment::getIceId(const Ice::Current&) const
580 {
581 Ice::Identity id;
582 id.name = (parentMemory ? parentMemory->getMemoryName() : "") + "_" + segmentName;
583 return id;
584 }
585
586 std::string
588 {
589 return segmentName;
590 }
591
592 EntityIdList
593 PersistentEntitySegment::getAllEntityIds(const ::Ice::Current& c) const
594 {
597 }
598
599 EntityIdList
601 {
602 EntityIdList result;
603
604 for (CollectionPrxList::const_iterator it = readCollections.begin();
605 it != readCollections.end();
606 ++it)
607 {
608 if (!*it)
609 {
610 continue;
611 }
612
613 const EntityIdList collIds = (*it)->findAllIds();
614 result.insert(result.end(), collIds.begin(), collIds.end());
615 }
616 return result;
617 }
618
619 EntityBaseList
620 PersistentEntitySegment::getAllEntities(const ::Ice::Current& c) const
621 {
622 EntityBaseList result;
624
625 for (const auto& col : readCollections)
626 {
627 if (!col)
628 {
629 continue;
630 }
631
632 for (const auto& dbEntity : col->findAll())
633 {
634 auto entity = deserializeEntity(dbEntity);
635
636 if (entity)
637 {
638 result.push_back(std::move(entity));
639 }
640 }
641 }
642
643 return result;
644 }
645
646 IdEntityMap
647 PersistentEntitySegment::getIdEntityMap(const ::Ice::Current& c) const
648 {
649 IdEntityMap result;
650
651 for (auto&& entity : getAllEntities())
652 {
653 result.insert({entity->getId(), std::move(entity)});
654 }
655
656 return result;
657 }
658
659 EntityBasePtr
660 PersistentEntitySegment::deserializeEntity(const DBStorableData& dbEntity) const
661 {
662 std::unique_lock lock(dbSerializerMutex);
663 EntityBasePtr entity;
664
665 try
666 {
667 entity = EntityBasePtr::dynamicCast(dbSerializer->deserializeIceObject(dbEntity));
668 }
669 catch (const armarx::JSONException& ex)
670 {
671 entity = EntityBasePtr();
672 }
673
674 return entity;
675 }
676
677 EntityRefBasePtr
679 const Ice::Current& c) const
680 {
681 auto entity = getEntityById(id);
682
683 if (!entity)
684 {
685 return NULL;
686 }
687
688 auto proxy =
689 EntityMemorySegmentInterfacePrx::uncheckedCast(c.adapter->createProxy(getIceId()));
690 SegmentedMemoryPtr mem = SegmentedMemoryPtr::dynamicCast(parentMemory);
691 std::string memName = mem->getMemoryName();
692 auto memoryProxy =
693 MemoryInterfacePrx::checkedCast(c.adapter->getCommunicator()->stringToProxy(memName));
694 EntityRefPtr ref = new EntityRef(entity, segmentName, memName, memoryProxy, proxy);
695 return ref;
696 }
697
698 EntityRefBasePtr
700 const Ice::Current& c) const
701 {
702 auto entity = getEntityByName(name);
703
704 if (!entity)
705 {
706 return NULL;
707 }
708
709 auto proxy =
710 EntityMemorySegmentInterfacePrx::uncheckedCast(c.adapter->createProxy(getIceId()));
711 SegmentedMemoryPtr mem = SegmentedMemoryPtr::dynamicCast(parentMemory);
712 std::string memName = mem->getMemoryName();
713 auto memoryProxy =
714 MemoryInterfacePrx::checkedCast(c.adapter->getCommunicator()->stringToProxy(memName));
715 EntityRefPtr ref = new EntityRef(entity, segmentName, memName, memoryProxy, proxy);
716 return ref;
717 }
718
719 void
721 const EntityAttributeBasePtr& attribute,
722 const Ice::Current& c)
723 {
724 EntityBasePtr entity = getEntityById(entityId);
725 if (!entity)
726 {
727 throw EntityNotFoundException();
728 }
729 entity->putAttribute(attribute);
730 DBStorableData dbEntity;
731 {
732 std::unique_lock lock(dbSerializerMutex);
733 dbEntity = dbSerializer->serializeIceObject(entity);
734 }
736
737 writeCollection->update(dbEntity);
738 }
739
740 void
742 const EntityAttributeList& attributeMap,
743 const Ice::Current& c)
744 {
745 EntityBasePtr entity = getEntityById(entityId);
746 if (!entity)
747 {
748 throw EntityNotFoundException();
749 }
750 for (auto attribute : attributeMap)
751 {
752 entity->putAttribute(attribute);
753 }
754 {
755 DBStorableData dbEntity;
756 {
757 std::unique_lock lock(dbSerializerMutex);
758 dbEntity = dbSerializer->serializeIceObject(entity);
759 }
761 writeCollection->update(dbEntity);
762 }
763 }
764
765 void
767 const Ice::Current&)
768 {
769 this->parentMemory = memory;
770 }
771
772 EntityRefList
773 PersistentEntitySegment::findRefsByQuery(const std::string& query, const Ice::Current& c)
774 {
775 EntityRefList result;
777
778 for (CollectionPrxList::const_iterator it = readCollections.begin();
779 it != readCollections.end();
780 ++it)
781 {
782 if (!*it)
783 {
784 continue;
785 }
786
787 CollectionInterfacePrx prx = *it;
788 const DBStorableDataList data = prx->findByQuery(query);
789
790 for (const DBStorableData& e : data)
791 {
792 EntityBasePtr entity = deserializeEntity(e);
793
794 if (entity)
795 {
796 auto proxy = EntityMemorySegmentInterfacePrx::uncheckedCast(
797 c.adapter->createProxy(getIceId()));
798 SegmentedMemoryPtr mem = SegmentedMemoryPtr::dynamicCast(parentMemory);
799 std::string memName = mem->getMemoryName();
800 auto memoryProxy = MemoryInterfacePrx::checkedCast(
801 c.adapter->getCommunicator()->stringToProxy(memName));
802 EntityRefPtr ref =
803 new EntityRef(entity, segmentName, memName, memoryProxy, proxy);
804 result.push_back(ref);
805 }
806 }
807 }
808
809 return result;
810 }
811
812 void
813 PersistentEntitySegment::setSegmentName(const std::string& segmentName, const Ice::Current&)
814 {
815 this->segmentName = segmentName;
816 }
817} // namespace memoryx
uint8_t data[1]
constexpr T c
The EntityRef class is used to store references to Entities as values in other Entity instances.
Definition EntityRef.h:47
void setSegmentName(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
void setParentMemory(const MemoryInterfacePtr &memory, const Ice::Current &) override
PersistentEntitySegment(CollectionInterfacePrx entityCollection, Ice::CommunicatorPtr ic, bool useMongoIds=true)
virtual EntityBasePtr getEntityByIdThreadUnsafe(const ::std::string &entityId) const
EntityRefList findRefsByQuery(const std::string &query, const Ice::Current &c) override
retrieves Entity Refs that match the query.
virtual EntityIdList getAllEntityIdsThreadUnsafe() const
void clear(const ::Ice::Current &=Ice::emptyCurrent) override
clear removes all elements from the current memoryx::PersistentEntitySegment::writeCollection
void addReadCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
virtual std::string upsertEntityByNameThreadUnsafe(const std::string &entityName, const EntityBasePtr &entity)
std::string addEntity(const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
addEntity add new entity and return the newly generated entity ID
virtual std::string addEntityThreadUnsafe(const EntityBasePtr &entity)
virtual std::string upsertEntityThreadUnsafe(const std::string &entityId, const EntityBasePtr &entity)
bool hasEntityById(const std::string &entityId, const Ice::Current &=Ice::emptyCurrent) const override
void print(const ::Ice::Current &=Ice::emptyCurrent) const override
virtual EntityIdList upsertEntityListThreadUnsafe(const EntityBaseList &entityList)
std::string getSegmentName(const ::Ice::Current &=Ice::emptyCurrent) const override
EntityBasePtr getEntityById(const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) const override
void setEntityAttribute(const std::string &entityId, const EntityAttributeBasePtr &attribute, const Ice::Current &) override
std::string getObjectTypeId(const ::Ice::Current &=Ice::emptyCurrent) const override
std::string upsertEntityByName(const std::string &entityName, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
NameList getReadCollectionsNS(const ::Ice::Current &=Ice::emptyCurrent) const override
EntityIdList upsertEntityList(const EntityBaseList &entityList, const Ice::Current &=Ice::emptyCurrent) override
bool hasEntityByIdThreadUnsafe(const std::string &entityId) const
void removeAllEntities(const ::Ice::Current &c=Ice::emptyCurrent) override
removeAllEntities collects all entities managed by this memory segment and removes them from the segm...
void setSingleRWCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
EntityIdList getAllEntityIds(const ::Ice::Current &=Ice::emptyCurrent) const override
void clearReadCollections(const ::Ice::Current &=Ice::emptyCurrent) override
virtual EntityBasePtr getEntityByNameThreadUnsafe(const ::std::string &name) const
std::string upsertEntity(const std::string &entityId, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
virtual EntityIdList addEntityListThreadUnsafe(const EntityBaseList &entityList)
virtual void updateEntityThreadUnsafe(const ::std::string &entityId, const EntityBasePtr &update)
virtual void removeEntityThreadUnsafe(const ::std::string &entityId)
bool hasEntityByName(const std::string &entityName, const Ice::Current &=Ice::emptyCurrent) const override
EntityBaseList getEntitiesByAttrValue(const ::std::string &attrName, const ::std::string &attrValue, const ::Ice::Current &=Ice::emptyCurrent) const override
::Ice::Identity getIceId(const ::Ice::Current &=Ice::emptyCurrent) const override
std::string getWriteCollectionNS(const ::Ice::Current &=Ice::emptyCurrent) const override
EntityBasePtr deserializeEntity(const DBStorableData &dbEntity) const
EntityBaseList getAllEntities(const ::Ice::Current &=Ice::emptyCurrent) const override
getAllEntities returns a list of all entities managed by this memory segment
bool hasEntityByNameThreadUnsafe(const std::string &entityName) const
void removeEntity(const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) override
removeEntity removes an entity with the ID entityId
void setWriteCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
EntityIdList addEntityList(const EntityBaseList &entityList, const Ice::Current &=Ice::emptyCurrent) override
addEntityList adds all entities contained in \entityList to this segment and returns a list of create...
EntityRefBasePtr getEntityRefByName(const std::string &name, const Ice::Current &c) const override
void setEntityAttributes(const std::string &entityId, const EntityAttributeList &attributeMap, const Ice::Current &) override
EntityBaseList getEntitiesByAttrValueList(const ::std::string &attrName, const NameList &attrValueList, const ::Ice::Current &=Ice::emptyCurrent) const override
IdEntityMap getIdEntityMap(const ::Ice::Current &=Ice::emptyCurrent) const override
Ice::Int size(const ::Ice::Current &=Ice::emptyCurrent) const override
size counts the number of memoryx::Entity instances contained available reachable throuhg memoryx::Pe...
EntityRefBasePtr getEntityRefById(const std::string &id, const Ice::Current &) const override
void updateEntity(const ::std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &=Ice::emptyCurrent) override
EntityBasePtr getEntityByName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
std::unique_ptr< ScopedSharedLock > ScopedSharedLockPtr
ScopedSharedLockPtr getReadLock(const Ice::Current &c) const
ScopedUniqueLockPtr getWriteLock(const Ice::Current &c) const
std::unique_ptr< ScopedSharedLock > ScopedUniqueLockPtr
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_ERROR_S
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:216
#define ARMARX_INFO_S
Definition Logging.h:202
::IceInternal::Handle<::Ice::Communicator > CommunicatorPtr
Definition IceManager.h:49
VirtualRobot headers.
IceInternal::Handle< EntityRef > EntityRefPtr
Definition EntityRef.h:38
IceInternal::Handle< SegmentedMemory > SegmentedMemoryPtr