rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
ArrayList< Type, Dimention > Class Template Reference

#include <fl_stack.h>

Collaboration diagram for ArrayList< Type, Dimention >:
Collaboration graph
[legend]

Public Member Functions

 ArrayList ()
 
void reset (void)
 
Type * add (void)
 
void removeAt (int index)
 

Data Fields

int size
 
Type elements [Dimention]
 

Detailed Description

template<class Type, int Dimention>
class ArrayList< Type, Dimention >

Definition at line 90 of file fl_stack.h.

Constructor & Destructor Documentation

◆ ArrayList()

template<class Type , int Dimention>
ArrayList< Type, Dimention >::ArrayList ( void  )

Definition at line 101 of file fl_stack.h.

101 {
102 memset(&elements, 0, sizeof(elements));
103 reset();
104}
void reset(void)
Definition fl_stack.h:115
Type elements[Dimention]
Definition fl_stack.h:94

Member Function Documentation

◆ add()

template<class Type , int Dimention>
Type * ArrayList< Type, Dimention >::add ( void  )

Definition at line 120 of file fl_stack.h.

120 {
121 efiAssert(ObdCode::CUSTOM_ERR_ASSERT, size < Dimention, "add() too many elements", (Type *)NULL);
122 return &elements[size++];
123}
int size
Definition fl_stack.h:93
@ CUSTOM_ERR_ASSERT

◆ removeAt()

template<class Type , int Dimention>
void ArrayList< Type, Dimention >::removeAt ( int  index)

Definition at line 107 of file fl_stack.h.

107 {
108 efiAssertVoid(ObdCode::CUSTOM_ERR_ARRAY_REMOVE, index >= 0 && index < size, "invalid index");
109 memcpy(&elements[index], &elements[size - 1], sizeof(Type));
110 memset(&elements[size - 1], 0, sizeof(Type));
111 size--;
112}
@ CUSTOM_ERR_ARRAY_REMOVE

◆ reset()

template<class Type , int Dimention>
void ArrayList< Type, Dimention >::reset ( void  )

Definition at line 115 of file fl_stack.h.

115 {
116 size = 0;
117}

Field Documentation

◆ elements

template<class Type , int Dimention>
Type ArrayList< Type, Dimention >::elements[Dimention]

Definition at line 94 of file fl_stack.h.

◆ size

template<class Type , int Dimention>
int ArrayList< Type, Dimention >::size

Definition at line 93 of file fl_stack.h.


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