SILICON
Loading...
Searching...
No Matches
DocumentStore Class Reference

#include <projectDocument.hpp>

Collaboration diagram for DocumentStore:

Public Types

using Listener = std::function<void(const DocumentChange&)>

Public Member Functions

const Document * find (std::string_view documentPath) const noexcept
bool contains (std::string_view documentPath) const noexcept
bool contains (DocumentType type) const noexcept
const std::vector< Document > & getDocuments () const noexcept
std::optional< std::size_t > indexOf (std::string_view documentPath) const
std::uint64_t addListener (Listener listener) const
void removeListener (std::uint64_t id) const

Private Member Functions

void commitDocuments (std::vector< Document > documents, const DocumentChange &change) noexcept

Private Attributes

std::vector< Document > documents
SILICON::core::CallbackRegistry< const DocumentChange & > listeners

Friends

class ProjectContext

Detailed Description

Definition at line 137 of file projectDocument.hpp.

Member Typedef Documentation

◆ Listener

using Listener = std::function<void(const DocumentChange&)>

Definition at line 139 of file projectDocument.hpp.

Member Function Documentation

◆ addListener()

std::uint64_t addListener ( Listener listener) const

Definition at line 292 of file projectDocument.cpp.

◆ commitDocuments()

void commitDocuments ( std::vector< Document > documents,
const DocumentChange & change )
privatenoexcept

Definition at line 302 of file projectDocument.cpp.

◆ contains() [1/2]

bool contains ( DocumentType type) const
nodiscardnoexcept

Definition at line 272 of file projectDocument.cpp.

◆ contains() [2/2]

bool contains ( std::string_view documentPath) const
nodiscardnoexcept

Definition at line 267 of file projectDocument.cpp.

◆ find()

const Document * find ( std::string_view documentPath) const
nodiscardnoexcept

Returned pointers/references are invalidated by any store mutation.

Definition at line 261 of file projectDocument.cpp.

◆ getDocuments()

const std::vector< Document > & getDocuments ( ) const
nodiscardnoexcept

Definition at line 278 of file projectDocument.cpp.

◆ indexOf()

std::optional< std::size_t > indexOf ( std::string_view documentPath) const
nodiscard

Definition at line 284 of file projectDocument.cpp.

◆ removeListener()

void removeListener ( std::uint64_t id) const

Definition at line 297 of file projectDocument.cpp.

◆ ProjectContext

friend class ProjectContext
friend

Definition at line 152 of file projectDocument.hpp.

Member Data Documentation

◆ documents

std::vector<Document> documents
private

Definition at line 157 of file projectDocument.hpp.

◆ listeners

SILICON::core::CallbackRegistry<const DocumentChange&> listeners
mutableprivate

Definition at line 158 of file projectDocument.hpp.


The documentation for this class was generated from the following files: