Access channels and controls via at function

To avoid UB on out of range access.
pull/3236/head
elsid 4 months ago
parent ca2bacd47a
commit 58b72e3836
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -84,11 +84,11 @@ namespace ICS
// in seconds // in seconds
void update(float timeSinceLastFrame); void update(float timeSinceLastFrame);
inline Channel* getChannel(int i){ return mChannels[i]; }; Channel* getChannel(int i){ return mChannels.at(i); };
float getChannelValue(int i); float getChannelValue(int i);
inline int getChannelCount(){ return (int)mChannels.size(); }; inline int getChannelCount(){ return (int)mChannels.size(); };
inline Control* getControl(int i){ return mControls[i]; }; Control* getControl(int i){ return mControls.at(i); };
float getControlValue(int i); float getControlValue(int i);
inline int getControlCount(){ return (int)mControls.size(); }; inline int getControlCount(){ return (int)mControls.size(); };
inline void addControl(Control* control){ mControls.push_back(control); }; inline void addControl(Control* control){ mControls.push_back(control); };

Loading…
Cancel
Save