Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | Protected Member Functions | Friends | List of all members
bridges::datastructure::Array< E > Class Template Reference

#include <Array.h>

Inheritance diagram for bridges::datastructure::Array< E >:
bridges::datastructure::DataStructure bridges::datastructure::Array1D< E > bridges::datastructure::Array2D< E > bridges::datastructure::Array3D< E >

Detailed Description

template<typename E>
class bridges::datastructure::Array< E >

The foundation of BRIDGES array types. It is not meant to be used directly by students.

This class can be used to create 1D, 2D, and 3D arrays of any type.

Parameters
Ethe application data type
Author
Kalpathi Subramanian
Date
1/14/17, 7/12/19

Public Member Functions

virtual const string getDStype () const override
 
virtual const string getDataStructureRepresentation () const override final
 
 Array (const Array &)=delete
 
Arrayoperator= (const Array &)=delete
 
- Public Member Functions inherited from bridges::datastructure::DataStructure
virtual ~DataStructure ()=default
 

Protected Member Functions

 Array ()
 
virtual ~Array ()
 
 Array (int sz)
 builds an array given the size More...
 
void setSize (int nd, int *dim)
 Set the size of the array. More...
 
void getDimensions (int *dim)
 Get the dimensions of the array. More...
 
int const * getDimensions () const
 
Element< E > & getElement (int index)
 
Element< E > const & getElement (int index) const
 Get the object at index index - 1D array. More...
 
void setElement (int ind, Element< E > el)
 Set the Element at index ind - 1D array. More...
 

Friends

class Element< E >
 

Constructor & Destructor Documentation

◆ Array() [1/3]

template<typename E >
bridges::datastructure::Array< E >::Array ( )
inlineprotected

◆ ~Array()

template<typename E >
virtual bridges::datastructure::Array< E >::~Array ( )
inlineprotectedvirtual

◆ Array() [2/3]

template<typename E >
bridges::datastructure::Array< E >::Array ( int  sz)
inlineprotected

builds an array given the size

Parameters
szsize of array

◆ Array() [3/3]

template<typename E >
bridges::datastructure::Array< E >::Array ( const Array< E > &  )
delete

Member Function Documentation

◆ getDataStructureRepresentation()

template<typename E >
virtual const string bridges::datastructure::Array< E >::getDataStructureRepresentation ( ) const
inlinefinaloverridevirtual

Ease of use function for the deletion of an entire datastructure. Overrides should call delete on itself and each linked data structure

Warning
Only call if all these data structures were all dynamicaly allocated(aka: using new) Gets the JSON representation of this DataStructure's nodes and links
Returns
The JSON representation of the data structure: A pair holding the nodes and links JSON strings respectively

Implements bridges::datastructure::DataStructure.

◆ getDimensions() [1/2]

template<typename E >
int const* bridges::datastructure::Array< E >::getDimensions ( ) const
inlineprotected

◆ getDimensions() [2/2]

template<typename E >
void bridges::datastructure::Array< E >::getDimensions ( int *  dim)
inlineprotected

Get the dimensions of the array.

Parameters
[out]diman array to return the dimensions

◆ getDStype()

template<typename E >
virtual const string bridges::datastructure::Array< E >::getDStype ( ) const
inlineoverridevirtual

Get the data structure type

Returns
data structure name

Implements bridges::datastructure::DataStructure.

◆ getElement() [1/2]

template<typename E >
Element<E>& bridges::datastructure::Array< E >::getElement ( int  index)
inlineprotected

Get the object at index index - 1D array

Parameters
indexindex into the array
Returns
the Element at 'index'

◆ getElement() [2/2]

template<typename E >
Element<E> const& bridges::datastructure::Array< E >::getElement ( int  index) const
inlineprotected

Get the object at index index - 1D array.

Parameters
index- index into the array
Returns
the Element at 'index'

◆ operator=()

template<typename E >
Array& bridges::datastructure::Array< E >::operator= ( const Array< E > &  )
delete

◆ setElement()

template<typename E >
void bridges::datastructure::Array< E >::setElement ( int  ind,
Element< E >  el 
)
inlineprotected

Set the Element at index ind - 1D array.

Parameters
indindex into the array
elElement object

◆ setSize()

template<typename E >
void bridges::datastructure::Array< E >::setSize ( int  nd,
int *  dim 
)
inlineprotected

Set the size of the array.

Parameters
[in]ndnumber of dimension
[in]dimthe size of the dimensions

Friends And Related Function Documentation

◆ Element< E >

template<typename E >
friend class Element< E >
friend

The documentation for this class was generated from the following file: