21 #ifndef LOADABLE_DEVICE_IMPL_H 22 #define LOADABLE_DEVICE_IMPL_H 29 #include <boost/filesystem/path.hpp> 30 #include "ossie/Autocomplete.h" 32 typedef std::multimap<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string, std::string> > >
64 void strip_empty_paths();
65 std::vector<std::string> paths;
75 void addModification(
const std::string _path_to_modify,
const std::string &_path_modification) {
76 modifications.push_back(std::make_pair(_path_to_modify, _path_modification));
91 if (getenv(
"LD_LIBRARY_PATH"))
95 if (getenv(
"PYTHONPATH"))
99 if (getenv(
"CLASSPATH"))
103 if (getenv(
"OCTAVE_PATH"))
116 setenv(
"CLASSPATH",
classpath.c_str(), 1);
130 if (getenv(
"LD_LIBRARY_PATH"))
131 ld_lib_path = getenv(
"LD_LIBRARY_PATH");
134 if (getenv(
"PYTHONPATH"))
135 pythonpath = getenv(
"PYTHONPATH");
138 if (getenv(
"CLASSPATH"))
139 classpath = getenv(
"CLASSPATH");
142 if (getenv(
"OCTAVE_PATH"))
143 octave_path = getenv(
"OCTAVE_PATH");
148 setenv(
"LD_LIBRARY_PATH", ld_lib_path.c_str(), 1);
149 setenv(
"PYTHONPATH", pythonpath.c_str(), 1);
150 setenv(
"CLASSPATH", classpath.c_str(), 1);
151 setenv(
"OCTAVE_PATH", octave_path.c_str(), 1);
154 std::string ld_lib_path, pythonpath, classpath, octave_path;
160 #ifdef BEGIN_AUTOCOMPLETE_IGNORE 161 public virtual POA_CF::LoadableDevice,
173 void configure (
const CF::Properties& configProperties)
174 throw (CF::PropertySet::PartialConfiguration,
175 CF::PropertySet::InvalidConfiguration, CORBA::SystemException);
178 void load (CF::FileSystem_ptr fs,
const char* fileName,
179 CF::LoadableDevice::LoadType loadKind)
180 throw (CF::LoadableDevice::LoadFail, CF::InvalidFileName,
181 CF::LoadableDevice::InvalidLoadKind, CF::Device::InvalidState,
182 CORBA::SystemException);
184 void do_load (CF::FileSystem_ptr fs,
const char* fileName, CF::LoadableDevice::LoadType loadKind)
185 throw (CF::LoadableDevice::LoadFail, CF::InvalidFileName,
186 CF::LoadableDevice::InvalidLoadKind, CF::Device::InvalidState,
187 CORBA::SystemException);
190 void unload (
const char* fileName)
191 throw (CF::InvalidFileName, CF::Device::InvalidState,
192 CORBA::SystemException);
195 throw (CF::InvalidFileName, CF::Device::InvalidState,
196 CORBA::SystemException);
220 void update_ld_library_path (CF::FileSystem_ptr fs,
const char* fileName, CF::LoadableDevice::LoadType loadKind)
throw (CORBA::SystemException, CF::Device::InvalidState, CF::LoadableDevice::InvalidLoadKind, CF::InvalidFileName, CF::LoadableDevice::LoadFail);
221 void update_octave_path (CF::FileSystem_ptr fs,
const char* fileName, CF::LoadableDevice::LoadType loadKind)
throw (CORBA::SystemException, CF::Device::InvalidState, CF::LoadableDevice::InvalidLoadKind, CF::InvalidFileName, CF::LoadableDevice::LoadFail);
234 std::map<std::string, time_t> cacheTimestamps;
235 std::map<std::string, std::vector<std::string> > duplicate_filenames;
237 void _loadTree(CF::FileSystem_ptr fs, std::string remotePath, boost::filesystem::path& localPath, std::string fileKey);
238 void _deleteTree(
const std::string &fileKey);
239 bool _treeIntact(
const std::string &fileKey);
240 void _copyFile(CF::FileSystem_ptr fs,
const std::string &remotePath,
const std::string &localPath,
const std::string &fileKey);
void from_string(const std::string &path)
void update_selected_paths(std::vector< sharedLibraryStorage > &paths)
Definition: LoadableDevice_impl.h:68
virtual ~LoadableDevice_impl()
Definition: LoadableDevice_impl.h:127
std::string octave_path
Definition: LoadableDevice_impl.h:118
Definition: LoadableDevice_impl.h:88
std::multimap< std::string, std::string, std::less< std::string >, std::allocator< std::pair< std::string, std::string > > > copiedFiles_type
Definition: LoadableDevice_impl.h:33
std::string ld_lib_path
Definition: LoadableDevice_impl.h:118
Definition: LoadableDevice_impl.h:39
std::map< std::string, sharedLibraryStorage > sharedPkgs
Definition: LoadableDevice_impl.h:223
void setTransferSize(uint64_t xfersize)
Definition: LoadableDevice_impl.h:202
std::string pythonpath
Definition: LoadableDevice_impl.h:118
std::map< std::string, CF::FileSystem::FileType > fileTypeTable
Definition: LoadableDevice_impl.h:216
void update_octave_path(CF::FileSystem_ptr fs, const char *fileName, CF::LoadableDevice::LoadType loadKind)
void unload(const char *fileName)
boost::recursive_mutex load_execute_lock
Definition: LoadableDevice_impl.h:219
envState()
Definition: LoadableDevice_impl.h:129
std::string classpath
Definition: LoadableDevice_impl.h:118
std::map< std::string, int > loadedFiles
Definition: LoadableDevice_impl.h:214
void do_load(CF::FileSystem_ptr fs, const char *fileName, CF::LoadableDevice::LoadType loadKind)
void removeDuplicateFiles(std::string fileName)
void load(CF::FileSystem_ptr fs, const char *fileName, CF::LoadableDevice::LoadType loadKind)
void merge_front_environment_path(const char *environment_variable, const std::string &path) const
void set()
Definition: LoadableDevice_impl.h:113
Definition: Device_impl.h:40
void update_path(sharedLibraryStorage &packageDescription)
std::vector< std::pair< std::string, std::string > > modifications
Definition: LoadableDevice_impl.h:81
EnvironmentPathParser(const std::string &path="")
void incrementFile(std::string)
bool isFileLoaded(const char *fileName)
envStateContainer initialState
Definition: LoadableDevice_impl.h:224
void decrementFile(std::string)
envStateContainer()
Definition: LoadableDevice_impl.h:90
void addModification(const std::string _path_to_modify, const std::string &_path_modification)
Definition: LoadableDevice_impl.h:75
std::string filename
Definition: LoadableDevice_impl.h:77
void update_ld_library_path(CF::FileSystem_ptr fs, const char *fileName, CF::LoadableDevice::LoadType loadKind)
void do_unload(const char *fileName)
Definition: LoadableDevice_impl.h:159
~envState()
Definition: LoadableDevice_impl.h:147
CORBA::LongLong transferSize
Definition: LoadableDevice_impl.h:228
std::string to_string() const
void setFilename(std::string _filename)
Definition: LoadableDevice_impl.h:71
void merge_front(const std::string &path)
copiedFiles_type copiedFiles
Definition: LoadableDevice_impl.h:218
void configure(const CF::Properties &configProperties)