#ifndef RESOURCE_MANAGER_TYPES_H
#define RESOURCE_MANAGER_TYPES_H

#include <memory>
#include <variant>

#include "opatIO.h"
#include "helm.h"
#include "meshIO.h"
#include "eosIO.h"

/**
 * @file resourceManagerTypes.h
 * @brief Defines types and functions for managing resources.
 * 
 * This file provides type definitions and functions for handling different
 * types of resources in a unified manner.
 */

// -- Valid resource types
/**
 * @brief A variant type that can hold different types of resources.
 * 
 * The Resource type is a std::variant that can hold a unique pointer to
 * an OpatIO, MeshIO, or EosIO object.
 * 
 * Example usage:
 * @code
 * Resource resource = std::make_unique<OpatIO>(...);
 * @endcode
 */
using Resource = std::variant<
                    std::unique_ptr<opat::OPAT>,
                    std::unique_ptr<MeshIO>,
                    std::unique_ptr<EosIO>>;

/**
 * @brief Extracts the first segment of a given string.
 * 
 * This function takes a string input and returns the first segment
 * separated by a delimiter (default is '/').
 * 
 * @param input The input string to be processed.
 * @return The first segment of the input string.
 * 
 * Example usage:
 * @code
 * std::string segment = getFirstSegment("path/to/resource");
 * // segment == "path"
 * @endcode
 */
std::string getFirstSegment(const std::string& input);

/**
 * @brief Creates a resource based on the specified type and path.
 * 
 * This function creates a resource object based on the provided type
 * and initializes it using the given path.
 * 
 * @param type The type of the resource to be created (e.g., "OpatIO", "MeshIO", "EosIO").
 * @param path The path to initialize the resource with.
 * @return A Resource object initialized with the specified type and path.
 * 
 * Example usage:
 * @code
 * Resource resource = createResource("OpatIO", "path/to/opat");
 * @endcode
 */
Resource createResource(const std::string& type, const std::string& path);

#endif // RESOURCE_MANAGER_TYPES_H