#include <G4GIDI.hh>
|
| G4GIDI (G4int ip, std::string &dataDirectory) |
|
| G4GIDI (G4int ip, std::list< std::string > &dataDirectory) |
|
| ~G4GIDI () |
|
G4int | numberOfDataDirectories (void) |
|
G4int | addDataDirectory (std::string &dataDirectory) |
|
G4int | removeDataDirectory (std::string &dataDirectory) |
|
std::string | getDataDirectoryAtIndex (G4int index) |
|
std::vector< std::string > * | getDataDirectories (void) |
|
G4bool | isThisDataAvailable (std::string &lib_name, G4int iZ, G4int iA, G4int iM=0) |
|
G4bool | isThisDataAvailable (std::string &lib_name, std::string &targetName) |
|
char * | dataFilename (std::string &lib_name, G4int iZ, G4int iA, G4int iM=0) |
|
char * | dataFilename (std::string &lib_name, std::string &targetName) |
|
std::vector< std::string > * | getNamesOfAvailableLibraries (G4int iZ, G4int iA, G4int iM=0) |
|
std::vector< std::string > * | getNamesOfAvailableLibraries (std::string &targetName) |
|
std::vector< std::string > * | getNamesOfAvailableTargets (void) |
|
G4GIDI_target * | readTarget (std::string &lib_name, G4int iZ, G4int iA, G4int iM=0, G4bool bind=true) |
|
G4GIDI_target * | readTarget (std::string &lib_name, std::string &targetName, G4bool bind=true) |
|
G4GIDI_target * | getAlreadyReadTarget (G4int iZ, G4int iA, G4int iM=0) |
|
G4GIDI_target * | getAlreadyReadTarget (std::string &targetName) |
|
G4int | freeTarget (G4int iZ, G4int iA, G4int iM=0) |
|
G4int | freeTarget (std::string &targetSymbol) |
|
G4int | freeTarget (G4GIDI_target *target) |
|
std::vector< std::string > * | getListOfReadTargetsNames (void) |
|
Definition at line 41 of file G4GIDI.hh.
◆ G4GIDI() [1/2]
G4GIDI::G4GIDI |
( |
G4int | ip, |
|
|
std::string & | dataDirectory ) |
Definition at line 37 of file G4GIDI.cc.
37 {
38
39 init( ip );
41}
G4int addDataDirectory(std::string &dataDirectory)
◆ G4GIDI() [2/2]
G4GIDI::G4GIDI |
( |
G4int | ip, |
|
|
std::list< std::string > & | dataDirectory ) |
◆ ~G4GIDI()
Definition at line 54 of file G4GIDI.cc.
54 {
55
57 auto iter = dataDirectories.cbegin();
58
59 while( targets.size( ) > 0 ) {
60 target = targets.back( );
61 targets.pop_back( );
62 delete target;
63 }
64
65 while( iter != dataDirectories.cend() ) {
66 delete *iter;
67 dataDirectories.pop_front( );
68 }
69}
◆ addDataDirectory()
G4int G4GIDI::addDataDirectory |
( |
std::string & | dataDirectory | ) |
|
Definition at line 106 of file G4GIDI.cc.
106 {
107
108 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter ) {
109 if( (*iter)->path( ) == dataDirectory ) return( 0 );
110 }
111
113 dataDirectories.push_back( map );
114
115 return( 0 );
116}
Referenced by G4GIDI().
◆ dataFilename() [1/2]
char * G4GIDI::dataFilename |
( |
std::string & | lib_name, |
|
|
G4int | iZ, |
|
|
G4int | iA, |
|
|
G4int | iM = 0 ) |
Definition at line 186 of file G4GIDI.cc.
186 {
187
189
190 if( targetName == nullptr ) return( nullptr );
191 string targetSymbol( targetName );
194 return( fileName );
195}
char * G4GIDI_Misc_Z_A_m_ToName(int iZ, int iA, int im=0)
char * dataFilename(std::string &lib_name, G4int iZ, G4int iA, G4int iM=0)
void * smr_freeMemory(void **p)
Referenced by dataFilename(), isThisDataAvailable(), and readTarget().
◆ dataFilename() [2/2]
char * G4GIDI::dataFilename |
( |
std::string & | lib_name, |
|
|
std::string & | targetName ) |
Definition at line 199 of file G4GIDI.cc.
199 {
200
201 char *path;
202
203 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter )
204 if( ( path =
MCGIDI_map_findTarget(
nullptr, (*iter)->map, lib_name.c_str(), projectile.c_str( ), targetSymbol.c_str( ) ) ) !=
nullptr )
205 return( path );
206
207 return( nullptr );
208}
char * MCGIDI_map_findTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *evaluation, const char *projectile, const char *targetName)
◆ freeTarget() [1/3]
Definition at line 316 of file G4GIDI.cc.
316 {
317
318 for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
319 if( *iter_targets == target ) {
320 targets.erase( iter_targets );
321 delete target;
322 return( 0 );
323 }
324 }
325 return( 1 );
326}
◆ freeTarget() [2/3]
Definition at line 330 of file G4GIDI.cc.
330 {
331
334
335 if( targetName == nullptr ) return( 1 );
336 string targetSymbol( targetName );
339 return( status );
340}
G4int freeTarget(G4int iZ, G4int iA, G4int iM=0)
Referenced by freeTarget(), and freeTarget().
◆ freeTarget() [3/3]
G4int G4GIDI::freeTarget |
( |
std::string & | targetSymbol | ) |
|
Definition at line 344 of file G4GIDI.cc.
344 {
345
346 for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
347 if( (*iter_targets)->name == targetSymbol )
return(
freeTarget( *iter_targets ) );
348 }
349 return( 1 );
350}
◆ getAlreadyReadTarget() [1/2]
Definition at line 292 of file G4GIDI.cc.
292 {
293
296
297 if( targetName == nullptr ) return( nullptr );
298 string targetSymbol( targetName );
301 return( target );
302}
G4GIDI_target * getAlreadyReadTarget(G4int iZ, G4int iA, G4int iM=0)
Referenced by getAlreadyReadTarget().
◆ getAlreadyReadTarget() [2/2]
G4GIDI_target * G4GIDI::getAlreadyReadTarget |
( |
std::string & | targetName | ) |
|
Definition at line 306 of file G4GIDI.cc.
306 {
307
308 for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
309 if( ( (*iter_targets)->name == targetSymbol ) ) return( *iter_targets );
310 }
311 return( nullptr );
312}
◆ getDataDirectories()
vector< string > * G4GIDI::getDataDirectories |
( |
void | | ) |
|
Definition at line 147 of file G4GIDI.cc.
147 {
148
149 std::size_t i = 0;
151
152 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter, ++i )
153 (*v)[i] = string( (*iter)->fileName( ) );
154 return( v );
155}
G4int numberOfDataDirectories(void)
◆ getDataDirectoryAtIndex()
string G4GIDI::getDataDirectoryAtIndex |
( |
G4int | index | ) |
|
Definition at line 132 of file G4GIDI.cc.
132 {
133
134 unsigned i = (unsigned) index;
135
136 if( index >= 0 ) {
137 if( i >= dataDirectories.size( ) ) return( "" );
138 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter, --index )
139 if( index == 0 ) return( (*iter)->fileName( ) );
140 }
141
142 return( "" );
143}
◆ getListOfReadTargetsNames()
vector< string > * G4GIDI::getListOfReadTargetsNames |
( |
void | | ) |
|
Definition at line 354 of file G4GIDI.cc.
354 {
355
356 vector<string> *listOfTargets;
357
358 listOfTargets = new vector<string>( );
359 if( listOfTargets == nullptr ) return( nullptr );
360 for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
361 listOfTargets->push_back( *(*iter_targets)->getName( ) );
362 }
363 return( listOfTargets );
364}
◆ getNamesOfAvailableLibraries() [1/2]
vector< string > * G4GIDI::getNamesOfAvailableLibraries |
( |
G4int | iZ, |
|
|
G4int | iA, |
|
|
G4int | iM = 0 ) |
◆ getNamesOfAvailableLibraries() [2/2]
vector< string > * G4GIDI::getNamesOfAvailableLibraries |
( |
std::string & | targetName | ) |
|
Definition at line 226 of file G4GIDI.cc.
226 {
227
228 vector<string> *listOfLibraries = new vector<string>( );
229
232
233 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter ) {
236 listOfLibraries->push_back( entry->
evaluation );
237 }
239 }
240 return( listOfLibraries );
241}
void * MCGIDI_map_free(statusMessageReporting *smr, MCGIDI_map *map)
MCGIDI_mapEntry * MCGIDI_map_getFirstEntry(MCGIDI_map *map)
MCGIDI_mapEntry * MCGIDI_map_getNextEntry(MCGIDI_mapEntry *entry)
MCGIDI_map * MCGIDI_map_findAllOfTarget(statusMessageReporting *smr, MCGIDI_map *map, const char *projectile, const char *targetName)
◆ getNamesOfAvailableTargets()
vector< string > * G4GIDI::getNamesOfAvailableTargets |
( |
void | | ) |
|
Definition at line 245 of file G4GIDI.cc.
245 {
246
247 vector<string> *listOfTargets;
248
249 listOfTargets = new vector<string>( );
250 if( listOfTargets == nullptr ) return( nullptr );
251 for( auto iter_map = dataDirectories.cbegin( ); iter_map != dataDirectories.cend( ); ++iter_map ) {
253 delete listOfTargets;
254 return( nullptr );
255 }
256 }
257 return( listOfTargets );
258}
int getNamesOfAvailableTargets_walker(GIDI::MCGIDI_mapEntry *entry, int level, void *userData)
int MCGIDI_map_walkTree(statusMessageReporting *smr, MCGIDI_map *map, int(*handler)(MCGIDI_mapEntry *entry, int level, void *userData), void *userData)
◆ isThisDataAvailable() [1/2]
Definition at line 159 of file G4GIDI.cc.
159 {
160
163
164 if( targetName == nullptr ) return( false );
165 string targetSymbol( targetName );
168 return( b );
169}
G4bool isThisDataAvailable(std::string &lib_name, G4int iZ, G4int iA, G4int iM=0)
Referenced by G4LENDManager::GetLENDTarget(), and isThisDataAvailable().
◆ isThisDataAvailable() [2/2]
G4bool G4GIDI::isThisDataAvailable |
( |
std::string & | lib_name, |
|
|
std::string & | targetName ) |
Definition at line 173 of file G4GIDI.cc.
173 {
174
176
177 if( path != nullptr ) {
179 return( true );
180 }
181 return( false );
182}
◆ numberOfDataDirectories()
G4int G4GIDI::numberOfDataDirectories |
( |
void | | ) |
|
◆ readTarget() [1/2]
Definition at line 262 of file G4GIDI.cc.
262 {
263
266
267 if( targetName == nullptr ) return( nullptr );
268 string targetSymbol( targetName );
269 target =
readTarget( lib_name, targetSymbol, bind );
271 return( target );
272}
G4GIDI_target * readTarget(std::string &lib_name, G4int iZ, G4int iA, G4int iM=0, G4bool bind=true)
Referenced by G4LENDManager::GetLENDTarget(), and readTarget().
◆ readTarget() [2/2]
G4GIDI_target * G4GIDI::readTarget |
( |
std::string & | lib_name, |
|
|
std::string & | targetName, |
|
|
G4bool | bind = true ) |
Definition at line 276 of file G4GIDI.cc.
276 {
277
278 for( auto iter_targets = targets.cbegin( ); iter_targets != targets.cend( ); ++iter_targets ) {
279 if( (*iter_targets)->name == targetName ) return( nullptr );
280 }
282 if( path == nullptr ) return( nullptr );
283
285 if( bind ) targets.push_back( target );
287 return( target );
288}
◆ removeDataDirectory()
G4int G4GIDI::removeDataDirectory |
( |
std::string & | dataDirectory | ) |
|
Definition at line 120 of file G4GIDI.cc.
120 {
121
122 for( auto iter = dataDirectories.cbegin( ); iter != dataDirectories.cend( ); ++iter ) {
123 if( dataDirectory == (*iter)->path( ) ) {
124
125 }
126 }
127 return( 0 );
128}
The documentation for this class was generated from the following files: