Go to the documentation of this file.
33 localPath_(localPath),
65 return owner_->
path()/localPath();
95 if( !repositories_.insertIf(rep->
name(), rep) )
99 "Failed to add repository " << rep->
name() <<
100 " to repository " << this->name() <<
101 ". It is already in this repository. \n";
111 auto name = rep->
name();
112 return repositories_.erase(name) == 1;
119 return objects_.search(nm);
126 if(
auto [iter, found] = objects_.findIf(nm); found)
128 return iter->second.typeName();
133 "Object name " << nm <<
" is not found in repository "<< name() <<
endl;
152 auto owner =
object->
owner();
158 owner =
object->
owner();
164 if( lookupObjectName(nm) )
return true;
166 for(
auto& rep:repositories_ )
170 if(rep.second->globalLookupObjectName(nm,
true))
return true;
180 return repositories_.search(nm);
185 if(lookupObjectName(nm))
return true;
186 if(lookupRepositoryName(nm))
return true;
192 return objects_.size();
197 return repositories_.size();
203 if(
auto [iter, success] = repositories_.findIf(name); success )
205 return *iter->second;
210 "repository with name " << name <<
" is not found in repository " << this->name()<<
endl <<
211 "list of avaiable repositories is \n" << repositoryNames();
213 return *iter->second;
220 for(
auto& ob:objects_)
222 names.push_back(ob.first);
230 for(
auto& rep:repositories_)
232 names.push_back(rep.first);
244 for(
auto& obj:objects_)
251 if(!obj.second.write())
258 for(
auto& rep:repositories_)
263 if(! rep.second->write(verbose) )
266 " error in writing repository " << rep.first <<
endl;
273 " repository " << rep.first <<
" is not a valid object to be referenced. \n";
virtual fileSystem localPath() const
#define warningInFunction
bool removeRepository(repository *rep)
const repository * owner() const
bool lookupObjectName(const word &nm) const
word lookupObjectTypeName(const word &nm) const
iOstream & endl(iOstream &os)
size_t numRepositories() const
virtual bool write(bool verbose=false) const
bool lookupRepositoryName(const word &nm) const
bool globalLookupObjectName(const word &nm, bool downward=false) const
#define fatalErrorInFunction
const pathType & path() const
wordList repositoryNames() const
const repository & thisRepository() const
repository(const word &name, const fileSystem &localPath, repository *owner=nullptr)
bool addToRepository(repository *rep)
virtual fileSystem path() const
bool lookupName(const word nm) const
repository & lookupRepository(const word &name)
size_t numObjects() const
wordList objectNames() const