RelationsMemorySegment.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::WorkingMemory
17 * @author Kai Welke ( welke 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 
26 
29 #include <MemoryX/interface/memorytypes/MemorySegments.h>
30 
31 namespace memoryx
32 {
34  virtual public WorkingMemoryEntitySegment<Relation>,
35  virtual public RelationMemorySegmentBase
36  {
37  public:
38  RelationBasePtr getRelationById(const ::std::string& id, const ::Ice::Current& = Ice::emptyCurrent) const override;
39 
40  RelationList getRelationsByName(const ::std::string& name, const ::Ice::Current& = Ice::emptyCurrent) const override;
41 
42  RelationList getRelationsBySign(bool sign, const ::Ice::Current& = Ice::emptyCurrent) const override;
43 
44  RelationList getRelationsByEntityId(const ::std::string& entityId, const ::Ice::Current& = Ice::emptyCurrent) const override;
45 
46  RelationList getRelationsByEntityRef(const EntityRefBasePtr& entityRef, const ::Ice::Current& = Ice::emptyCurrent) const override;
47 
48  RelationList getRelationsByEntityRefs(const EntityRefList& entities, const ::Ice::Current& = Ice::emptyCurrent) const override;
49 
50  RelationBasePtr getRelationByAttrValues(const std::string& name, const EntityRefList& entities, bool sign, const ::Ice::Current& = Ice::emptyCurrent) const override;
51 
52  private:
53  RelationList getRelationsByAttrValues(const EntityRefList& entities, const std::string& name = "", bool considerSign = false, bool sign = true, const ::Ice::Current& = Ice::emptyCurrent) const;
54 
55  // EntityMemorySegmentInterface interface
56  public:
57  std::string addEntity(const EntityBasePtr& entity, const Ice::Current&) override;
58  void updateEntity(const std::string& id, const EntityBasePtr& entity, const Ice::Current&) override;
59 
60  // RelationSegmentInterface interface
61  public:
62  void removeRelations(const std::string& name, const Ice::Current&) override;
63  void replaceRelations(const RelationList& newRelations, const Ice::Current&) override;
64  };
65 
67 
68 }
69 
armarx::sign
T sign(T t)
Definition: algorithm.h:194
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::RelationMemorySegment
Definition: RelationsMemorySegment.h:33
Relation.h
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::WorkingMemoryEntitySegment
Definition: WorkingMemoryEntitySegment.h:44
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
WorkingMemoryEntitySegment.h
ImportExportComponent.h