3 #ifndef XJMUSIC_SEGMENT_ENTITY_STORE_H
4 #define XJMUSIC_SEGMENT_ENTITY_STORE_H
25 #define SEGMENT_STORE_CORE_HEADERS(ENTITY, ENTITIES) \
26 const ENTITY *put(const ENTITY &choice); \
27 std::optional<const ENTITY *> read##ENTITY(int segmentId, const UUID &id); \
28 std::set<const ENTITY *> readAll##ENTITIES(int segmentId); \
29 std::set<const ENTITY *> readAll##ENTITIES(const std::set<int> &segmentIds); \
30 void delete##ENTITY(int segmentId, const UUID &id);
44 std::optional<Chain> chain;
45 std::map<int, Segment> segments;
46 std::map<int, std::map<UUID, SegmentChoice>> segmentChoices;
47 std::map<int, std::map<UUID, SegmentChoiceArrangement>> segmentChoiceArrangements;
48 std::map<int, std::map<UUID, SegmentChoiceArrangementPick>> segmentChoiceArrangementPicks;
49 std::map<int, std::map<UUID, SegmentChord>> segmentChords;
50 std::map<int, std::map<UUID, SegmentChordVoicing>> segmentChordVoicings;
51 std::map<int, std::map<UUID, SegmentMeme>> segmentMemes;
52 std::map<int, std::map<UUID, SegmentMessage>> segmentMessages;
53 std::map<int, std::map<UUID, SegmentMeta>> segmentMetas;
57 static void validate(
Segment entity);
Definition: SegmentChoiceArrangementPick.h:14
Definition: SegmentChoiceArrangement.h:14
Definition: SegmentChoice.h:15
Definition: SegmentChordVoicing.h:16
Definition: SegmentChord.h:13
Definition: SegmentEntityStore.h:43
std::vector< const Segment * > readSegmentsFromToOffset(int fromOffset, int toOffset)
Definition: SegmentEntityStore.cpp:128
std::optional< const Segment * > readSegmentAtChainMicros(const unsigned long long int chainMicros)
Definition: SegmentEntityStore.cpp:84
static void protectSegmentStateTransition(Segment::State fromState, Segment::State toState)
Definition: SegmentEntityStore.cpp:323
const Segment * updateSegment(Segment &segment)
Definition: SegmentEntityStore.cpp:274
int readLastSegmentId() const
Definition: SegmentEntityStore.cpp:183
void deleteSegment(int id)
Definition: SegmentEntityStore.cpp:310
std::vector< const Segment * > readAllSegmentsSpanning(const unsigned long long int fromChainMicros, const unsigned long long int toChainMicros)
Definition: SegmentEntityStore.cpp:172
void clear()
Definition: SegmentEntityStore.cpp:411
std::string readChoiceHash(const Segment &segment)
Definition: SegmentEntityStore.cpp:213
std::optional< const Segment * > readSegment(int segmentId)
Definition: SegmentEntityStore.cpp:97
int getSegmentCount() const
Definition: SegmentEntityStore.cpp:264
std::optional< Chain * > readChain()
Definition: SegmentEntityStore.cpp:93
std::optional< const Segment * > readSegmentLast()
Definition: SegmentEntityStore.cpp:191
static void onlyAllowSegmentStateTransitions(Segment::State toState, const std::set< Segment::State > &allowedStates)
Definition: SegmentEntityStore.cpp:357
std::optional< const SegmentChoice * > readChoice(int segmentId, Program::Type programType)
Definition: SegmentEntityStore.cpp:200
Chain * put(const Chain &c)
Definition: SegmentEntityStore.cpp:74
std::vector< const Segment * > readAllSegmentsInState(Segment::State segmentState)
Definition: SegmentEntityStore.cpp:115
std::vector< const SegmentChord * > readOrderedSegmentChords(int segmentId)
Definition: SegmentEntityStore.cpp:253
void deleteSegmentsBefore(int lastSegmentId)
Definition: SegmentEntityStore.cpp:385
std::vector< const Segment * > readAllSegments()
Definition: SegmentEntityStore.cpp:102
std::set< const SegmentChoiceArrangementPick * > readAllSegmentChoiceArrangementPicks(const std::vector< const Segment * > &forSegments)
Definition: SegmentEntityStore.cpp:227
void deleteChain()
Definition: SegmentEntityStore.cpp:305
void deleteSegmentsAfter(int lastSegmentId)
Definition: SegmentEntityStore.cpp:398
std::set< const SegmentEntity * > readAllSegmentEntities(const std::set< int > &segmentIds)
Definition: SegmentEntityStore.cpp:139
bool empty() const
Definition: SegmentEntityStore.cpp:269
SEGMENT_STORE_CORE_HEADERS(SegmentMeta, SegmentMetas)
Definition: SegmentEntity.h:15
Definition: SegmentMeme.h:13
Definition: SegmentMessage.h:14
Definition: ActiveAudio.h:11