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
Raw Normal View History

2019-03-10 15:23:11 +00:00
<?php
namespace Arma\Internal;
2019-04-04 08:07:37 +00:00
use Arma\FileType;
2019-03-13 15:19:05 +00:00
/**
* Interface for resizable objects (non-subview objects)
*
* @package Arma\Internal
*/
2019-03-10 15:23:11 +00:00
interface Resizable
{
2019-03-21 10:49:11 +00:00
// Set size
2019-03-10 15:23:11 +00:00
/**
* 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();
2019-03-21 10:49:11 +00:00
// 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);
2019-05-27 08:51:46 +00:00
// Saving/loading
2019-03-21 10:49:11 +00:00
/**
2019-07-12 17:50:16 +00:00
* Store data in a file or stream resource (Feature\STREAM_RES must be true).
2019-03-21 10:49:11 +00:00
*
2019-05-27 08:51:46 +00:00
* 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]).
*
2019-04-04 08:07:37 +00:00
* @param resource|string|array $dest
* @param int $file_type[optional]
2019-03-21 10:49:11 +00:00
* @return bool
*/
2019-04-04 08:07:37 +00:00
function save($dest, $file_type = FileType::ARMA_BINARY);
2019-03-21 10:49:11 +00:00
/**
2019-07-12 17:50:16 +00:00
* Retrieve data from a file or stream resource (Feature\STREAM_RES must be true).
2019-03-21 10:49:11 +00:00
*
2019-05-27 08:51:46 +00:00
* 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.
*
2019-03-21 10:49:11 +00:00
* On failure, the object is reset so that it has no elements.
*
2019-04-04 08:07:37 +00:00
* @param resource|string|array $from
* @param int $file_type[optional]
2019-03-21 10:49:11 +00:00
* @return bool
*/
2019-04-04 08:07:37 +00:00
function load($from, $file_type = FileType::AUTO_DETECT);
2019-03-10 15:23:11 +00:00
}