HumanProfileWriter.h
Go to the documentation of this file.
1#pragma once
2
3
4#include <mutex>
5#include <optional>
6#include <string>
7
9
13
14#include <VisionX/libraries/armem_human/aron/PersonInstance.aron.generated.h>
16#include <VisionX/libraries/armem_human/server/HumanMemoryServerInterface.h>
18
20{
21
23 {
24 public:
26
28
29 ~ProfileWriter() override;
30
32 void connect(armem::client::MemoryNameSystem& memoryNameSystem);
33
34 std::string
35 propertyPrefix() const override
36 {
37 return "mem.human.profile.";
38 };
39
40 Properties
41 defaultProperties() const override
42 {
43 return Properties{
44 .memoryName = "Human", .coreSegmentName = "Profile", .providerName = ""};
45 };
46
47 // FIXME remove provider, add to c'tor
48 bool commitHumanProfile(const Person& humanProfile,
49 const std::string& provider,
50 const armem::Time& referencedTime,
51 const std::string& entityName = "");
52
54 const std::string& providerName,
55 const armem::Time& referencedTime,
56 const armarx::armem::human::Preferences preferences);
57
59 const std::string& providerName,
60 const armem::Time& referencedTime,
61 const std::string key,
62 const std::string value);
63
64 bool commitHumanProfiles(const std::vector<Person>& humanProfiles,
65 const std::string& provider,
66 const armem::Time& referencedTime,
67 const std::string& entityName);
68
69 /**
70 * Inserts the given drink at the first place of the given humans list of preferred drinks,
71 * indicating it is the most favorite drink.
72 *
73 * If the list already contained the drink before, it is moved to the first entry of the
74 * list to prevent duplicate entries.
75 *
76 * @param personID identifier of the human (first and last name)
77 * @param providerName name of the profile provider
78 * @param referencedTime the time at which the preference change occured (used for memory
79 * timestamp)
80 * @param drink human-readable string describing the drink that is preferred (for
81 * example, 'orange juice')
82 * @return true iff. the preference was updated successfully
83 */
85 const std::string& providerName,
86 const armem::Time& referencedTime,
87 const std::string& drink);
88
89 private:
90 armem::human::HumanMemoryServerInterfacePrx humanMemory;
92 };
93
94} // namespace armarx::armem::human::client
The memory name system (MNS) client.
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
bool commitHumanProfiles(const std::vector< Person > &humanProfiles, const std::string &provider, const armem::Time &referencedTime, const std::string &entityName)
bool commitPreferencesToProfile(const armarx::armem::human::PersonID &personID, const std::string &providerName, const armem::Time &referencedTime, const armarx::armem::human::Preferences preferences)
bool commitHumanProfile(const Person &humanProfile, const std::string &provider, const armem::Time &referencedTime, const std::string &entityName="")
bool setCustomAttributeInProfile(const armarx::armem::human::PersonID &personID, const std::string &providerName, const armem::Time &referencedTime, const std::string key, const std::string value)
bool setPreferredDrink(const armarx::armem::human::PersonID &personID, const std::string &providerName, const armem::Time &referencedTime, const std::string &drink)
Inserts the given drink at the first place of the given humans list of preferred drinks,...
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
armarx::core::time::DateTime Time
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.