29#include <unordered_set>
85 std::shared_ptr<RepositoryManager> repo_manager);
127 void registerFactory(std::function<std::unique_ptr<ICommand>(
const std::string&)> factory);
144 std::unique_ptr<ICommand>
createCommand(
const std::string& name)
const;
227 std::shared_ptr<ISubject> event_bus_;
236 std::shared_ptr<RepositoryManager> repo_manager_;
247 std::vector<std::function<std::unique_ptr<ICommand>(
const std::string&)>> factories_;
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 registerFactory(std::function< std::unique_ptr< ICommand >(const std::string &)> factory)
Registers a factory function for command creation.
Definition CompositeCommandFactory.cxx:42
CompositeCommandFactory & operator=(const CompositeCommandFactory &)=delete
Deleted assignment operator.
size_t getFactoryCount() const
Gets the number of registered factories.
Definition CompositeCommandFactory.cxx:111
bool commandExists(const std::string &name) const
Checks if a command with the given name exists.
Definition CompositeCommandFactory.cxx:107
~CompositeCommandFactory()=default
Default destructor.
void showCommandHelp(const std::string &name) const
Shows detailed help for a command.
Definition CompositeCommandFactory.cxx:97
std::vector< std::string > getAllCommandNames() const
Gets names of all available commands from all factories.
Definition CompositeCommandFactory.cxx:56
std::unique_ptr< ICommand > createCommand(const std::string &name) const
Creates a command by name using registered factories.
Definition CompositeCommandFactory.cxx:46
std::string getCommandDescription(const std::string &name) const
Gets the description for a command.
Definition CompositeCommandFactory.cxx:89
CompositeCommandFactory(std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
Constructs a CompositeCommandFactory with necessary dependencies.
Definition CompositeCommandFactory.cxx:26
Command-line interface components and command implementations.
Core VCS data structures and object model.
System integration components and cross-cutting concerns.
Service layer components and infrastructure services.