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 
27 #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,
39  const ::Ice::Current& = Ice::emptyCurrent) const override;
40 
41  RelationList getRelationsByName(const ::std::string& name,
42  const ::Ice::Current& = Ice::emptyCurrent) const override;
43 
44  RelationList getRelationsBySign(bool sign,
45  const ::Ice::Current& = Ice::emptyCurrent) const override;
46 
47  RelationList
48  getRelationsByEntityId(const ::std::string& entityId,
49  const ::Ice::Current& = Ice::emptyCurrent) const override;
50 
51  RelationList
52  getRelationsByEntityRef(const EntityRefBasePtr& entityRef,
53  const ::Ice::Current& = Ice::emptyCurrent) const override;
54 
55  RelationList
56  getRelationsByEntityRefs(const EntityRefList& entities,
57  const ::Ice::Current& = Ice::emptyCurrent) const override;
58 
59  RelationBasePtr
60  getRelationByAttrValues(const std::string& name,
61  const EntityRefList& entities,
62  bool sign,
63  const ::Ice::Current& = Ice::emptyCurrent) const override;
64 
65  private:
66  RelationList getRelationsByAttrValues(const EntityRefList& entities,
67  const std::string& name = "",
68  bool considerSign = false,
69  bool sign = true,
70  const ::Ice::Current& = Ice::emptyCurrent) const;
71 
72  // EntityMemorySegmentInterface interface
73  public:
74  std::string addEntity(const EntityBasePtr& entity, const Ice::Current&) override;
75  void updateEntity(const std::string& id,
76  const EntityBasePtr& entity,
77  const Ice::Current&) override;
78 
79  // RelationSegmentInterface interface
80  public:
81  void removeRelations(const std::string& name, const Ice::Current&) override;
82  void replaceRelations(const RelationList& newRelations, const Ice::Current&) override;
83  };
84 
86 
87 } // namespace memoryx
armarx::sign
T sign(T t)
Definition: algorithm.h:214
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:45
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
WorkingMemoryEntitySegment.h
ImportExportComponent.h