This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/stubs/internal/Resizable.php

83 lines
2.0 KiB
PHP

<?php
namespace Arma\Internal;
use Arma\FileType;
/**
* Interface for resizable objects (non-subview objects)
*
* @package Arma\Internal
*/
interface Resizable
{
// Set size
/**
* Set the size to be the same as the given object.
*
* The given object must be of the same root type as the calling object.
*
* @param static $other
* @return void
*/
function copySize($other);
/**
* Reset the size to zero. The object will have no elements.
*
* @return void
*/
function reset();
// Assignment
/**
* Set the real part of the object.
*
* Given object must have the same size as the recipient object.
*
* @param static $other
* @return void
*/
function setReal($other);
/**
* Set the imaginary part of the object.
*
* Given object must have the same size as the recipient object.
*
* @param static $other
* @return void
*/
function setImag($other);
// Saving/loading
/**
* Store data in a file or stream resource (Feature\STREAM_RES must be true).
*
* Data will be saved to $dest, which can be the file name, stream handle, or (HDF5 only) an array which
* specifies HDF5 names and options (['file_name' => string, 'dataset_name' => string, 'options' => int]).
*
* @param resource|string|array $dest
* @param int $file_type[optional]
* @return bool
*/
function save($dest, $file_type = FileType::ARMA_BINARY);
/**
* Retrieve data from a file or stream resource (Feature\STREAM_RES must be true).
*
* Data will be read from $from, which can be the source file name, stream handle, or (HDF5 only)
* an array which specifies HDF5 names and options.
*
* On failure, the object is reset so that it has no elements.
*
* @param resource|string|array $from
* @param int $file_type[optional]
* @return bool
*/
function load($from, $file_type = FileType::AUTO_DETECT);
}