Indexed ownership, control, assignment, and typed-relation graph. 更多...
#include <SocialGraph.h>
Public 成员函数 | |
| bool | setOwner (const EntityId &entity, const EntityId &owner) |
| Sets an entity's owner; an empty owner removes ownership. | |
| EntityId | ownerOf (const EntityId &entity) const |
| Returns an entity's owner, or an empty string when absent. | |
| std::vector< EntityId > | ownedBy (const EntityId &owner) const |
| Returns entities owned by owner in deterministic ID order. | |
| bool | setController (const EntityId &entity, const EntityId &controller) |
| Sets an entity's controller; an empty controller removes control. | |
| EntityId | controllerOf (const EntityId &entity) const |
| Returns an entity's controller, or an empty string when absent. | |
| std::vector< EntityId > | controlledBy (const EntityId &controller) const |
| Returns entities controlled by controller in deterministic ID order. | |
| bool | assign (const EntityId &source, const std::string &role, const EntityId &target) |
| Adds a role-based source-to-target assignment. | |
| bool | unassign (const EntityId &source, const std::string &role, const EntityId &target) |
| Removes a role-based source-to-target assignment. | |
| bool | isAssigned (const EntityId &source, const std::string &role, const EntityId &target) const |
| Tests whether an exact assignment exists. | |
| std::vector< EntityId > | targetsOf (const EntityId &source, const std::string &role) const |
| Returns targets assigned from source with role in deterministic order. | |
| std::vector< EntityId > | assigneesOf (const EntityId &target, const std::string &role) const |
| Returns sources assigned to target with role in deterministic order. | |
| bool | setRelation (const EntityId &source, const EntityId &target, const std::string &type, double value) |
| Sets a directed typed relation weight, creating the edge if needed. | |
| double | addRelation (const EntityId &source, const EntityId &target, const std::string &type, double delta) |
| Adds delta to a directed typed relation and returns its new weight. | |
| bool | link (const EntityId &source, const EntityId &target, const std::string &type) |
| Creates a directed typed relation with weight 1. | |
| bool | removeRelation (const EntityId &source, const EntityId &target, const std::string &type) |
| Removes an exact directed typed relation. | |
| bool | hasRelation (const EntityId &source, const EntityId &target, const std::string &type) const |
| Tests whether an exact directed typed relation exists. | |
| double | relation (const EntityId &source, const EntityId &target, const std::string &type, double fallback=0.0) const |
| Gets an exact relation weight, or fallback when absent. | |
| std::vector< EntityId > | relationTargets (const EntityId &source, const std::string &type, double minimum=0.0) const |
| Returns outgoing relation targets filtered by type and minimum weight. | |
| std::vector< EntityId > | relationSources (const EntityId &target, const std::string &type, double minimum=0.0) const |
| Returns incoming relation sources filtered by type and minimum weight. | |
| bool | removeEntity (const EntityId &entity) |
| Removes an entity and every incoming/outgoing graph reference to it. | |
| void | clear () |
| Clears all graph state and pending events. | |
| const std::vector< SocialChangeEvent > & | events () const |
| Returns queued mutation events in sequence order. | |
| void | clearEvents () |
| Clears queued events without changing graph state. | |
静态 Public 成员函数 | |
| static EntityId | integerId (std::int64_t id) |
| Converts a stable integer ID to its canonical graph key. | |
详细描述
Indexed ownership, control, assignment, and typed-relation graph.
IDs are opaque. String IDs are stored verbatim; integer helpers use a reserved representation so integer 12 cannot collide with the string "12".
在文件 SocialGraph.h 第 34 行定义.
成员函数说明
◆ addRelation()
| double eve::social::SocialGraph::addRelation | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type, | ||
| double | delta | ||
| ) |
Adds delta to a directed typed relation and returns its new weight.
在文件 SocialGraph.cpp 第 134 行定义.
引用了 relation(), setRelation(), source, target, type , 以及 value.
被这些函数引用 eve::social::Social::addRelation().
◆ assign()
| bool eve::social::SocialGraph::assign | ( | const EntityId & | source, |
| const std::string & | role, | ||
| const EntityId & | target | ||
| ) |
Adds a role-based source-to-target assignment.
在文件 SocialGraph.cpp 第 86 行定义.
引用了 source, target , 以及 valid.
被这些函数引用 eve::social::Social::assign() , 以及 eve::social::Social::assignInt().
◆ assigneesOf()
| std::vector< EntityId > eve::social::SocialGraph::assigneesOf | ( | const EntityId & | target, |
| const std::string & | role | ||
| ) | const |
Returns sources assigned to target with role in deterministic order.
在文件 SocialGraph.cpp 第 116 行定义.
引用了 found, target , 以及 values.
被这些函数引用 eve::social::Social::assigneeAt() , 以及 eve::social::Social::assigneeCount().
◆ clear()
| void eve::social::SocialGraph::clear | ( | ) |
Clears all graph state and pending events.
在文件 SocialGraph.cpp 第 215 行定义.
被这些函数引用 eve::social::Social::clear().
◆ clearEvents()
|
inline |
Clears queued events without changing graph state.
在文件 SocialGraph.h 第 90 行定义.
被这些函数引用 eve::social::Social::clearEvents().
◆ controlledBy()
Returns entities controlled by controller in deterministic ID order.
在文件 SocialGraph.cpp 第 81 行定义.
被这些函数引用 eve::social::Social::controlledAt(), eve::social::Social::controlledCount() , 以及 removeEntity().
◆ controllerOf()
Returns an entity's controller, or an empty string when absent.
在文件 SocialGraph.cpp 第 76 行定义.
引用了 found.
被这些函数引用 eve::social::Social::controllerOf(), eve::social::Social::controllerOfInt() , 以及 setController().
◆ events()
|
inline |
Returns queued mutation events in sequence order.
在文件 SocialGraph.h 第 88 行定义.
被这些函数引用 eve::social::Social::eventCount().
◆ hasRelation()
| bool eve::social::SocialGraph::hasRelation | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type | ||
| ) | const |
Tests whether an exact directed typed relation exists.
在文件 SocialGraph.cpp 第 156 行定义.
被这些函数引用 eve::social::Social::hasRelation().
◆ integerId()
|
static |
Converts a stable integer ID to its canonical graph key.
在文件 SocialGraph.cpp 第 20 行定义.
被这些函数引用 eve::social::Social::assignInt(), eve::social::Social::controllerOfInt(), eve::social::Social::idFromInt(), eve::social::Social::ownerOfInt(), eve::social::Social::removeEntityInt(), eve::social::Social::setControllerInt(), eve::social::Social::setOwnerInt() , 以及 eve::social::Social::setRelationInt().
◆ isAssigned()
| bool eve::social::SocialGraph::isAssigned | ( | const EntityId & | source, |
| const std::string & | role, | ||
| const EntityId & | target | ||
| ) | const |
Tests whether an exact assignment exists.
在文件 SocialGraph.cpp 第 106 行定义.
引用了 found, source , 以及 target.
被这些函数引用 eve::social::Social::isAssigned().
◆ link()
| bool eve::social::SocialGraph::link | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type | ||
| ) |
Creates a directed typed relation with weight 1.
在文件 SocialGraph.cpp 第 140 行定义.
引用了 setRelation(), source, target , 以及 type.
被这些函数引用 eve::social::Social::link().
◆ ownedBy()
Returns entities owned by owner in deterministic ID order.
在文件 SocialGraph.cpp 第 56 行定义.
被这些函数引用 eve::social::Social::ownedAt(), eve::social::Social::ownedCount() , 以及 removeEntity().
◆ ownerOf()
Returns an entity's owner, or an empty string when absent.
在文件 SocialGraph.cpp 第 51 行定义.
引用了 found.
被这些函数引用 eve::social::Social::ownerOf(), eve::social::Social::ownerOfInt() , 以及 setOwner().
◆ relation()
| double eve::social::SocialGraph::relation | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type, | ||
| double | fallback = 0.0 |
||
| ) | const |
Gets an exact relation weight, or fallback when absent.
在文件 SocialGraph.cpp 第 160 行定义.
引用了 found, source, target , 以及 type.
被这些函数引用 addRelation(), eve::social::Social::relation(), relationSources() , 以及 relationTargets().
◆ relationSources()
| std::vector< EntityId > eve::social::SocialGraph::relationSources | ( | const EntityId & | target, |
| const std::string & | type, | ||
| double | minimum = 0.0 |
||
| ) | const |
Returns incoming relation sources filtered by type and minimum weight.
在文件 SocialGraph.cpp 第 177 行定义.
引用了 found, minimum, relation(), source, target , 以及 type.
被这些函数引用 eve::social::Social::relationSourceAt() , 以及 eve::social::Social::relationSourceCount().
◆ relationTargets()
| std::vector< EntityId > eve::social::SocialGraph::relationTargets | ( | const EntityId & | source, |
| const std::string & | type, | ||
| double | minimum = 0.0 |
||
| ) | const |
Returns outgoing relation targets filtered by type and minimum weight.
在文件 SocialGraph.cpp 第 166 行定义.
引用了 found, minimum, relation(), source, target , 以及 type.
被这些函数引用 eve::social::Social::relationTargetAt() , 以及 eve::social::Social::relationTargetCount().
◆ removeEntity()
| bool eve::social::SocialGraph::removeEntity | ( | const EntityId & | entity | ) |
Removes an entity and every incoming/outgoing graph reference to it.
在文件 SocialGraph.cpp 第 188 行定义.
引用了 controlledBy(), key, owned, ownedBy(), removeRelation(), setController(), setOwner(), source, target, type, unassign(), valid , 以及 value.
被这些函数引用 eve::social::Social::removeEntity() , 以及 eve::social::Social::removeEntityInt().
◆ removeRelation()
| bool eve::social::SocialGraph::removeRelation | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type | ||
| ) |
Removes an exact directed typed relation.
在文件 SocialGraph.cpp 第 144 行定义.
引用了 found, key, source, target , 以及 type.
被这些函数引用 removeEntity() , 以及 eve::social::Social::removeRelation().
◆ setController()
| bool eve::social::SocialGraph::setController | ( | const EntityId & | entity, |
| const EntityId & | controller | ||
| ) |
Sets an entity's controller; an empty controller removes control.
在文件 SocialGraph.cpp 第 61 行定义.
引用了 controllerOf() , 以及 valid.
被这些函数引用 removeEntity(), eve::social::Social::setController() , 以及 eve::social::Social::setControllerInt().
◆ setOwner()
Sets an entity's owner; an empty owner removes ownership.
在文件 SocialGraph.cpp 第 36 行定义.
被这些函数引用 removeEntity(), eve::social::Social::setOwner() , 以及 eve::social::Social::setOwnerInt().
◆ setRelation()
| bool eve::social::SocialGraph::setRelation | ( | const EntityId & | source, |
| const EntityId & | target, | ||
| const std::string & | type, | ||
| double | value | ||
| ) |
Sets a directed typed relation weight, creating the edge if needed.
在文件 SocialGraph.cpp 第 121 行定义.
引用了 found, key, source, target, type, valid , 以及 value.
被这些函数引用 addRelation(), link(), eve::social::Social::setRelation() , 以及 eve::social::Social::setRelationInt().
◆ targetsOf()
| std::vector< EntityId > eve::social::SocialGraph::targetsOf | ( | const EntityId & | source, |
| const std::string & | role | ||
| ) | const |
Returns targets assigned from source with role in deterministic order.
在文件 SocialGraph.cpp 第 111 行定义.
引用了 found, source , 以及 values.
被这些函数引用 eve::social::Social::targetAt() , 以及 eve::social::Social::targetCount().
◆ unassign()
| bool eve::social::SocialGraph::unassign | ( | const EntityId & | source, |
| const std::string & | role, | ||
| const EntityId & | target | ||
| ) |
Removes a role-based source-to-target assignment.
在文件 SocialGraph.cpp 第 96 行定义.
引用了 found, source , 以及 target.
被这些函数引用 removeEntity() , 以及 eve::social::Social::unassign().
该类的文档由以下文件生成:
- src/modules/social/SocialGraph.h
- src/modules/social/SocialGraph.cpp