Commit 3b27d05a authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed boundLoad from Array and Object - needed only in MeshFunction and VectorField

parent 67d4cba3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ void export_Object( py::module & m )
        // TODO: make it abstract class in Python
        .def("save", (void (TNL::Object::*)(const TNL::String &) const) &TNL::Object::save)
        .def("load", (void (TNL::Object::*)(const TNL::String &)) &TNL::Object::load)
        .def("boundLoad", (void (TNL::Object::*)(const TNL::String &)) &TNL::Object::boundLoad)
        // FIXME: why does it not work?
//        .def("save", py::overload_cast<TNL::File>(&TNL::Object::save, py::const_))
//        .def("load", py::overload_cast<TNL::File>(&TNL::Object::load))
+0 −14
Original line number Diff line number Diff line
@@ -537,24 +537,10 @@ class Array : public Object
       */
      void load( File& file );

      /**
       * \brief This method loads data without reallocation.
       *
       * This is useful for loading data into shared arrays.
       * If the array was not initialize yet, common load is
       * performed. Otherwise, the array size must fit with
       * the size of array being loaded.
       *
       * This method is deprecated - use ArrayView instead.
       */
      void boundLoad( File& file );

      using Object::save;

      using Object::load;

      using Object::boundLoad;

      /** \brief Basic destructor. */
      ~Array();

+0 −21
Original line number Diff line number Diff line
@@ -677,27 +677,6 @@ load( File& file )
   Algorithms::ArrayIO< Value, Device, Index >::load( file, this->data, this->size );
}

template< typename Value,
          typename Device,
          typename Index >
void
Array< Value, Device, Index >::
boundLoad( File& file )
{
   Object::load( file );
   Index _size;
   file.load( &_size );
   if( _size < 0 )
      throw Exceptions::FileDeserializationError( file.getFileName(), "invalid array size: " + std::to_string(_size) );
   if( this->getSize() != 0 )
   {
      if( this->getSize() != _size )
         throw Exceptions::FileDeserializationError( file.getFileName(), "invalid array size: " + std::to_string(_size) + " (expected " + std::to_string( this->getSize() ) + ")." );
   }
   else setSize( _size );
   Algorithms::ArrayIO< Value, Device, Index >::load( file, this->data, this->size );
}

template< typename Value,
          typename Device,
          typename Index >
+1 −2
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public:
   // Returns true iff non-zero size is set
   operator bool() const;

   // TODO: serialization (save, load, boundLoad)
   // TODO: serialization (save, load)

protected:
   LocalRangeType localRange;
@@ -150,7 +150,6 @@ private:
   // TODO: disabled until they are implemented
   using Object::save;
   using Object::load;
   using Object::boundLoad;
};

} // namespace Containers
+2 −2
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ class MeshFunction :

      void boundLoad( File& file );

      void boundLoad( const String& fileName );

      bool write( const String& fileName,
                  const String& format = "vtk",
                  const double& scale = 1.0 ) const;
@@ -160,8 +162,6 @@ class MeshFunction :

      using Object::load;

      using Object::boundLoad;

      DistributedMeshSynchronizerType& getSynchronizer()
      {
         return this->synchronizer;
Loading