MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / create_container

Method create_container

src/session/src/session_actor.cpp:2148–2173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2146}
2147
2148void SessionActor::create_container(
2149 caf::actor actor,
2150 caf::typed_response_promise<std::pair<utility::Uuid, UuidActor>> rp,
2151 const Uuid &uuid_before,
2152 const bool into) {
2153
2154 mail(detail_atom_v)
2155 .request(actor, infinite)
2156 .await(
2157 [=](const ContainerDetail &detail) mutable {
2158 playlists_[detail.uuid_] = actor;
2159 link_to(actor);
2160 join_event_group(this, actor);
2161 PlaylistItem tmp(detail.name_, detail.type_, detail.uuid_);
2162 auto cuuid = base_.insert_container(tmp, uuid_before, into);
2163 if (not cuuid) {
2164 cuuid = base_.insert_container(tmp);
2165 }
2166 base_.send_changed();
2167 mail(utility::event_atom_v, add_playlist_atom_v, UuidActor(detail.uuid_, actor))
2168 .send(base_.event_group());
2169
2170 rp.deliver(std::make_pair(*cuuid, UuidActor(detail.uuid_, actor)));
2171 },
2172 [=](error &err) mutable { rp.deliver(err); });
2173}
2174
2175// this is gonna be fun...
2176// we need to serialise all items under and including uuid

Callers

nothing calls this directly

Calls 7

requestMethod · 0.80
send_changedMethod · 0.80
event_groupMethod · 0.80
deliverMethod · 0.80
UuidActorClass · 0.50
insert_containerMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected