16 template<
class ModelType>
19 using BaseT = std::function<void(ModelType &)>;
21 using BaseT::operator();
34 template<
class Po
interToMember>
38 template<
class ModelType,
class DataType>
42 using PtrT = DataType ModelType::*;
47 :
BaseT([ptr, data](ModelType &m) {
53 template<
class Po
interToMember>
60 ComposedModifier<ClientModel>
withRoom(RoomModel room);
61 ComposedModifier<ClientModel>
withAccountData(immer::flex_vector<Event> accountDataEvent);
62 ComposedModifier<ClientModel>
withCrypto(
const Crypto &crypto);
63 ComposedModifier<ClientModel>
withDevice(std::string userId, DeviceKeyInfo info);
66 ComposedModifier<DeviceKeyInfo>
withDeviceId(std::string deviceId);
70 Crypto
makeCrypto(
const ComposedModifier<Crypto> &mod = {});
72 RoomModel
makeRoom(
const ComposedModifier<RoomModel> &mod = {});
74 ComposedModifier<RoomModel>
withRoomId(std::string
id);
75 ComposedModifier<RoomModel>
withRoomAccountData(immer::flex_vector<Event> accountDataEvent);
76 ComposedModifier<RoomModel>
withRoomState(immer::flex_vector<Event> stateEvent);
86 ComposedModifier<Event>
withEventKV(
const json::json_pointer &k,
const json &v);
87 ComposedModifier<Event>
withEventId(std::string
id);
98 Response
makeResponse(std::string jobId,
const ComposedModifier<Response> &mod = {});
ComposedModifier< RoomModel > withRoomState(immer::flex_vector< Event > stateEvent)
Definition: factory.cpp:142
RoomModel makeRoom(const ComposedModifier< RoomModel > &mod)
Definition: factory.cpp:122
ComposedModifier< ClientModel > withCrypto(const Crypto &crypto)
Definition: factory.cpp:67
ComposedModifier< Event > withEventReplyTo(std::string eventId)
Definition: factory.cpp:273
ComposedModifier< DeviceKeyInfo > withDeviceId(std::string deviceId)
Definition: factory.cpp:100
ComposedModifier< RoomModel > withRoomTimelineGaps(immer::map< std::string, std::string > timelineGaps)
Definition: factory.cpp:156
ComposedModifier< Event > withEventId(std::string id)
Definition: factory.cpp:225
ComposedModifier< Event > withEventRelationship(std::string relType, std::string eventId)
Definition: factory.cpp:265
ComposedModifier< Event > withEventContent(const json &content)
Definition: factory.cpp:235
ComposedModifier< Event > withMemberAvatarUrl(std::string avatarUrl)
Definition: factory.cpp:255
ComposedModifier< RoomModel > withRoomEncrypted(bool encrypted)
Definition: factory.cpp:170
DeviceKeyInfo makeDeviceKeyInfo(const ComposedModifier< DeviceKeyInfo > &mod)
Definition: factory.cpp:84
ComposedModifier< RoomModel > withRoomTimeline(immer::flex_vector< Event > timelineEvents)
Definition: factory.cpp:149
ComposedModifier< RoomModel > withRoomMembership(RoomMembership membership)
Definition: factory.cpp:163
ComposedModifier< Event > withEventJson(const json &j)
Definition: factory.cpp:209
ClientModel makeClient(const ComposedModifier< ClientModel > &mod)
Definition: factory.cpp:41
ComposedModifier< DeviceKeyInfo > withDeviceDisplayName(std::string displayName)
Definition: factory.cpp:105
ComposedModifier< Event > withStateKey(std::string id)
Definition: factory.cpp:240
ComposedModifier< Response > withResponseStatusCode(int code)
Definition: factory.cpp:290
ComposedModifier< Event > withEventSenderId(std::string sender)
Definition: factory.cpp:260
ComposedModifier< Event > withEventType(std::string type)
Definition: factory.cpp:230
ComposedModifier< ClientModel > withRoom(RoomModel room)
Definition: factory.cpp:53
ComposedModifier< Response > withResponseJsonBody(const json &body)
Definition: factory.cpp:295
ComposedModifier< Response > withResponseDataKV(std::string k, const json &v)
Definition: factory.cpp:310
ComposedModifier< Response > withResponseBytesBody(const Bytes &body)
Definition: factory.cpp:300
ComposedModifier< Event > withEventKV(const json::json_pointer &k, const json &v)
Definition: factory.cpp:216
ComposedModifier< ClientModel > withAccountData(immer::flex_vector< Event > accountDataEvent)
Definition: factory.cpp:60
Event makeMemberEvent(const ComposedModifier< Event > &mod)
Definition: factory.cpp:193
ComposedModifier< Response > withResponseFileBody(const FileDesc &body)
Definition: factory.cpp:305
Event makeEvent(const ComposedModifier< Event > &mod)
Definition: factory.cpp:177
ComposedModifier< Event > withMembership(std::string membership)
Definition: factory.cpp:245
ComposedModifier< DeviceKeyInfo > withDeviceTrustLevel(DeviceTrustLevel trustLevel)
Definition: factory.cpp:110
ComposedModifier< Event > withMemberDisplayName(std::string displayName)
Definition: factory.cpp:250
ComposedModifier< ClientModel > withDevice(std::string userId, DeviceKeyInfo info)
Definition: factory.cpp:74
Crypto makeCrypto(const ComposedModifier< Crypto > &mod)
Definition: factory.cpp:115
ComposedModifier< RoomModel > withRoomId(std::string id)
Definition: factory.cpp:130
Response makeResponse(std::string jobId, const ComposedModifier< Response > &mod)
Definition: factory.cpp:280
ComposedModifier< RoomModel > withRoomInviteState(immer::flex_vector< Event > stateEvent)
ComposedModifier< RoomModel > withRoomAccountData(immer::flex_vector< Event > accountDataEvent)
Definition: factory.cpp:135
AttrModifier< PointerToMember > withAttr(PointerToMember p, const typename AttrModifier< PointerToMember >::DataT &data)
Definition: factory.hpp:54
Definition: location.hpp:10
DeviceTrustLevel
Definition: device-list-tracker.hpp:27
nlohmann::json json
Definition: jsonwrap.hpp:20
std::string Bytes
Definition: types.hpp:27
RoomMembership
Definition: types.hpp:128
Definition: client-model.hpp:59
DataType ModelType::* PtrT
Definition: factory.hpp:42
AttrModifier(PtrT ptr, const DataType &data)
Definition: factory.hpp:46
ModelType ModelT
Definition: factory.hpp:43
DataType DataT
Definition: factory.hpp:44
Definition: factory.hpp:36
Definition: factory.hpp:18
ComposedModifier operator|(const ComposedModifier &that) const
Definition: factory.hpp:25
std::function< void(ModelType &)> BaseT
Definition: factory.hpp:19
ComposedModifier()
Definition: factory.hpp:23