• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

Software development tool for distributed control systems

  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Product
    • Design UI
    • Develop
    • Analyze and test
    • Deploy
    • Framework and toolbox
    • Compatibility
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Simulator
  • StateVariableArray
  • 4.10.7

StateVariableArray Class

(CDPSim::StateVariableArray)

The StateVariableArray wraps an array of StateVariables. More...

Header: #include <DynamicSimComponent/StateVariableArray.h>
  • List of all members, including inherited members

Public Functions

StateVariableArray()
StateVariableArray(const StateVariableArray &other) = delete
~StateVariableArray()
void Create(const char *name, DynamicSimComponent *parent, int size)
void SetSize(int newSize)
int Size() const
StateVariableArray &operator=(const StateVariableArray &other) = delete
StateVariable &operator[](int i)

Detailed Description

The StateVariableArray wraps an array of StateVariables.

Usage

Create a member in the header file of a DynamicSimComponent inherited class.

Resizing

To resize the array, first call SetSize(), then call the owner component's Reset(). This can not be safely done while the simulator is running.

Features

  • Dynamically creates an array of StateVariable objects.
  • Size is specified as a parameter to Create(), or later by calling SetSize()
  • The array is registered as a child object of the DynamicSimComponent owner.
  • StateVariables created are registered as childs of the DynamicSimComponent

Member Function Documentation

StateVariableArray::StateVariableArray()

Default constructs an instance of StateVariableArray.

[delete] StateVariableArray::StateVariableArray(const StateVariableArray &other)

Copy constructor.

StateVariableArray::~StateVariableArray()

Destroys the instance of StateVariableArray.

void StateVariableArray::Create(const char *name, DynamicSimComponent *parent, int size)

Creates the instance, binds it to name and registers to parent.

void StateVariableArray::SetSize(int newSize)

Sets new size.

Must typically be called early in the parent's Reset() function since the new resize will not happen until a Reallocate() is called later (which is done by DynamicSimComponent::Reset()/SetupStateVariables())

int StateVariableArray::Size() const

Get number of StateVariables in this array.

[delete] StateVariableArray &StateVariableArray::operator=(const StateVariableArray &other)

Copy-assignment operator.

StateVariable &StateVariableArray::operator[](int i)

Allows notation like: A[4] = 3.0; and A[4].ddt = 2.0;

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

Follow CDP

    © Copyright 2021 CDP Technologies. Privacy and cookie policy.

    Return to top