📄 visint.cpp
字号:
#include <utils/visint.h>#include <iomanip>using namespace std;VisibleInteger::VisibleInteger(AlgAE::Color c): Visible(c), _color(c), indexed(0) {}VisibleInteger::VisibleInteger(int i, AlgAE::Color c): Visible(c), _color(c), _data(i), indexed(0) {}VisibleInteger::VisibleInteger(int i, const string& name, AlgAE::Color c): Visible(c), _color(c), _data(i), indexed(0) {setName (name);}VisibleInteger::VisibleInteger(int i, const char* name, AlgAE::Color c): Visible(c), _color(c), _data(i), indexed(0) {setName (name);}VisibleInteger::VisibleInteger (const VisibleInteger& x): Visible(x._color), _color(x._color), _data(x._data), indexed(0) {}void VisibleInteger::operator= (const VisibleInteger& x) {_data = x._data;}void VisibleInteger::operator= (const int x) {_data = x;}VisibleInteger::~VisibleInteger() {}VisibleInteger::operator int() const {return _data;}void VisibleInteger::touchAllPointers() const{ if (indexed != 0) { Visible* v = indexed->elementAt(_data); if (v != 0) touch (v, AlgAE::AnyDir); } }void VisibleInteger::writeText(ostream& out) const{ out << _data;}void VisibleInteger::indexes (const Indexable* arrayLike){ indexed = arrayLike;}VisibleInteger VisibleInteger::operator++ (int){ VisibleInteger clone (*this); ++_data; return clone;}VisibleInteger VisibleInteger::operator-- (int){ VisibleInteger clone (*this); --_data; return clone;}void assertionViolation (int line){ cerr << "Assertion violation in line " << line << endl;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -