📄 cmm.h
字号:
#ifndef CMM_H
#define CMM_H
#define DEFAULT_SIZE 20
#define MM_TOTAL_SIZE 100
#define MM_MAX_SIZE 30
typedef unsigned int uint;
/*要使用Clist,需提供prep,nextp,和<(),>()*/
class Cmm
{
public:
uint begin;
uint size;
Cmm* prep;
Cmm* nextp;
public:
Cmm():begin(0),size(0),prep(NULL),nextp(NULL){}
/*p紧邻this,即p,this顺序*/
bool extent_front(Cmm* p)
{
if( p && this->begin==p->begin+p->size )
{
this->begin=p->begin;
this->size+=p->size;
return true;
}
return false;
}
/*this紧邻p,即this,p顺序*/
bool extent_back(Cmm* p)
{
if( p && p->begin==this->begin+this->size )
{
this->size+=p->size;
return true;
}
return false;
}
bool div(uint needs)
{
if( size<needs )
return false;
size-=needs;
begin+=needs;
return true;
}
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -