use super::{CellIdentifier, SimulationError, SubDomainPlainIndex};
use crate::storage::StorageManager;
pub struct StorageAccess<C, S> {
pub cells: StorageManager<CellIdentifier, C>,
pub subdomains: StorageManager<SubDomainPlainIndex, S>,
}
impl<C, V> StorageAccess<C, V> {
pub fn get_path(&self) -> Result<std::path::PathBuf, SimulationError> {
match self.cells.extract_builder().get_full_path().parent() {
Some(p) => Ok(p.to_path_buf()),
None => Err(SimulationError::IoError(std::io::Error::from(
std::io::ErrorKind::NotFound,
))),
}
}
}