state.h
来自「一个简单使用的控制器」· C头文件 代码 · 共 53 行
H
53 行
#ifndef STATE_H#define STATE_H#include <vector>#include <string>using namespace std;/** * The state class. **/class State{ protected: vector<int> m_vars; struct timeval timestamp; public: State() {}; // Creates a state from a vector of state variables. State(vector<int> vars); // Returns the state vector. vector<int> get(void) const {return m_vars;} // Returns the value of the state variable with index 'index'. int getVar(int index) const; // Prints the state to standard output. void print() const; // Prints the state to a string. void print(string &str) const; // Returns the size of a state int size() {return (int) m_vars.size();}};#endif/********************************************************************* * (C) Copyright 2006 Albert Ludwigs University Freiburg * Institute of Computer Science * * All rights reserved. Use of this software is permitted for * non-commercial research purposes, and it may be copied only * for that use. All copies must include this copyright message. * This software is made available AS IS, and neither the authors * nor the Albert Ludwigs University Freiburg make any warranty * about the software or its performance. *********************************************************************/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?