24#include <unordered_map>
78 std::shared_ptr<ISubject> event_bus;
87 std::shared_ptr<RepositoryManager> repo_manager;
102 std::unordered_map<std::string,
103 std::function<std::unique_ptr<ICommand>(std::shared_ptr<ISubject>,
104 std::shared_ptr<RepositoryManager>)>> creators;
117 void registerDefaultCommands();
132 std::shared_ptr<RepositoryManager> repoManager);
164 std::function<std::unique_ptr<ICommand>(std::shared_ptr<ISubject>,
165 std::shared_ptr<RepositoryManager>)> creator);
208 std::unique_ptr<ICommand>
createCommand(
const std::string& name)
const;
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Declaration of the RepositoryManager class, managing all repository-level file operations.
void showCommandHelp(const std::string &name) const
Displays the detailed help and usage for a registered server command.
Definition ServerCommandFactory.cxx:55
std::vector< std::string > getRegisteredCommands() const
Retrieves a list of names for all currently registered server commands.
Definition ServerCommandFactory.cxx:72
ServerCommandFactory & operator=(const ServerCommandFactory &)=delete
Deletes the assignment operator. The Server Factory should not be assigned.
std::string getCommandDescription(const std::string &name) const
Retrieves the brief description for a registered server command.
Definition ServerCommandFactory.cxx:47
ServerCommandFactory(std::shared_ptr< ISubject > bus, std::shared_ptr< RepositoryManager > repoManager)
Constructs the ServerCommandFactory.
Definition ServerCommandFactory.cxx:21
void registerCommand(const std::string &name, std::function< std::unique_ptr< ICommand >(std::shared_ptr< ISubject >, std::shared_ptr< RepositoryManager >)> creator)
Registers a creator function for a new server command.
Definition ServerCommandFactory.cxx:41
std::unique_ptr< ICommand > createCommand(const std::string &name) const
Creates and returns a server command object by its name.
Definition ServerCommandFactory.cxx:64
bool commandExists(const std::string &name) const
Checks if a server command with the given name exists.
Definition ServerCommandFactory.cxx:80
Command-line interface components and command implementations.
Core VCS data structures and object model.
Server administration command-line interface components.
Service layer components and infrastructure services.