void load_array(serialization::array<T> const& x, unsigned int /* file_version */)
 {
   BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>));
   if (x.count())
     load_impl(x.address(), sizeof(T)*x.count());
 }
 void load(boost::archive::version_type & t){
     boost::intmax_t l;
     load_impl(l, sizeof(boost::archive::version_type));
     // use cast to avoid compile time warning
     t = boost::archive::version_type(l);
 }
 void load(boost::archive::class_id_type & t){
     boost::intmax_t l;
     load_impl(l, sizeof(boost::archive::class_id_type));
     // use cast to avoid compile time warning
     t = boost::archive::class_id_type(static_cast<int>(l));
 }
Example #4
0
 void load(boost::archive::library_version_type& t) {
     boost::int64_t l = 0;
     load_impl(l, sizeof(boost::uint16_t));
     t = boost::archive::library_version_type(static_cast<unsigned int>(l));
 }
 void load(boost::serialization::item_version_type & t){
     boost::intmax_t l;
     load_impl(l, sizeof(boost::serialization::item_version_type));
     // use cast to avoid compile time warning
     t = boost::serialization::item_version_type(l);
 }
Example #6
0
 void load(boost::archive::object_id_type& t) {
     boost::int64_t l = 0;
     load_impl(l, sizeof(boost::uint32_t));
     t = boost::archive::object_id_type(static_cast<std::size_t>(l));
 }
Example #7
0
 void load(boost::archive::object_reference_type& t) {
     boost::int64_t l = 0;
     load_impl(l, sizeof(boost::uint32_t));
     t = boost::archive::object_reference_type(
             boost::archive::object_id_type(std::size_t(l)));
 }
Example #8
0
 void load_integral(T& t, boost::mpl::true_)
 {
     boost::uint64_t l = 0;
     load_impl(l, sizeof(T));
     t = static_cast<T>(l);      // use cast to avoid compile time warning
 }
Example #9
0
 void load(boost::archive::class_id_type& t) {
     boost::int64_t l = 0;
     load_impl(l, sizeof(boost::int16_t));
     t = boost::archive::class_id_type(std::size_t(l));
 }
Example #10
0
 void load_array(serialization::array<T> const& x, unsigned int /* file_version */)
 {
   if (x.count())
     load_impl(x.address(), get_mpi_datatype(*x.address()), x.count());
 }
Example #11
0
 void load( T & t)
 {
   load_impl(&t, get_mpi_datatype(t), 1);
 }
Example #12
0
File: usUtils.cpp Project: 0r/MITK
US_BEGIN_NAMESPACE

std::vector<std::string> AutoLoadModulesFromPath(const std::string& absoluteBasePath, const std::string& subDir)
{
  std::vector<std::string> loadedModules;

  std::string loadPath = absoluteBasePath + DIR_SEP + subDir;

  DIR* dir = opendir(loadPath.c_str());
#ifdef CMAKE_INTDIR
  // Try intermediate output directories
  if (dir == NULL)
  {
    std::size_t indexOfLastSeparator = absoluteBasePath.find_last_of(DIR_SEP);
    if (indexOfLastSeparator != std::string::npos)
    {
      std::string intermediateDir = absoluteBasePath.substr(indexOfLastSeparator+1);
      bool equalSubDir = intermediateDir.size() == std::strlen(CMAKE_INTDIR);
      for (std::size_t i = 0; equalSubDir && i < intermediateDir.size(); ++i)
      {
        if (std::tolower(intermediateDir[i]) != std::tolower(CMAKE_INTDIR[i]))
        {
          equalSubDir = false;
        }
      }
      if (equalSubDir)
      {
        loadPath = absoluteBasePath.substr(0, indexOfLastSeparator+1) + subDir + DIR_SEP + CMAKE_INTDIR;
        dir = opendir(loadPath.c_str());
      }
    }
  }
#endif

  if (dir != NULL)
  {
    struct dirent *ent = NULL;
    while ((ent = readdir(dir)) != NULL)
    {
      bool loadFile = true;
#ifdef _DIRENT_HAVE_D_TYPE
      if (ent->d_type != DT_UNKNOWN && ent->d_type != DT_REG)
      {
        loadFile = false;
      }
#endif

      std::string entryFileName(ent->d_name);

      // On Linux, library file names can have version numbers appended. On other platforms, we
      // check the file ending. This could be refined for Linux in the future.
#if !defined(US_PLATFORM_LINUX)
      if (entryFileName.rfind(library_suffix()) != (entryFileName.size() - library_suffix().size()))
      {
        loadFile = false;
      }
#endif
      if (!loadFile) continue;

      std::string libPath = loadPath;
      if (!libPath.empty() && libPath.find_last_of(DIR_SEP) != libPath.size() -1)
      {
        libPath += DIR_SEP;
      }
      libPath += entryFileName;
      US_DEBUG << "Auto-loading module " << libPath;

      if (!load_impl(libPath))
      {
        US_WARN << "Auto-loading of module " << libPath << " failed.";
      }
      else
      {
        loadedModules.push_back(libPath);
      }
    }
    closedir(dir);
  }
  return loadedModules;
}
 void load(boost::serialization::item_version_type & t) {
     boost::intmax_t l = 0;
     load_impl(l, sizeof(boost::intmax_t));
     t = boost::serialization::item_version_type(static_cast<unsigned int>(l));
 }
 void load(boost::archive::version_type & t) {
     boost::intmax_t l = 0;
     load_impl(l, sizeof(boost::uint32_t));
     t = boost::archive::version_type(static_cast<unsigned int>(l));
 }
 void load(T & t) {
     boost::intmax_t l = 0;
     load_impl(l, sizeof(T));
     // use cast to avoid compile time warning
     t = static_cast<T>(l);
 }
 void load( T & t)
 {
   BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>));
   load_impl(&t, sizeof(T));
 }