本文整理匯總了C++中Enabled函數的典型用法代碼示例。如果您正苦於以下問題:C++ Enabled函數的具體用法?C++ Enabled怎麽用?C++ Enabled使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Enabled函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Enabled
void Node::Kill(bool bState)
{
if(bState)
Enabled(false);
else
Enabled(m_bInitEnabled);
}
示例2: ipv6cp_LayerUp
static int
ipv6cp_LayerUp(struct fsm *fp)
{
/* We're now up */
struct ipv6cp *ipv6cp = fsm2ipv6cp(fp);
char tbuff[40];
log_Printf(LogIPV6CP, "%s: LayerUp.\n", fp->link->name);
if (!ipv6cp_InterfaceUp(ipv6cp))
return 0;
snprintf(tbuff, sizeof tbuff, "%s", ncpaddr_ntoa(&ipv6cp->myaddr));
log_Printf(LogIPV6CP, "myaddr %s hisaddr = %s\n",
tbuff, ncpaddr_ntoa(&ipv6cp->hisaddr));
#ifndef NORADIUS
radius_Account_Set_Ipv6(&fp->bundle->radacct6, ipv6cp->his_ifid);
radius_Account(&fp->bundle->radius, &fp->bundle->radacct6,
fp->bundle->links, RAD_START, &ipv6cp->throughput);
/*
* XXX: Avoid duplicate evaluation of filterid between IPCP and
* IPV6CP. When IPCP is enabled and rejected, filterid is not
* evaluated.
*/
if (!Enabled(fp->bundle, OPT_IPCP)) {
if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid)
system_Select(fp->bundle, fp->bundle->radius.filterid, LINKUPFILE,
NULL, NULL);
}
#endif
/*
* XXX this stuff should really live in the FSM. Our config should
* associate executable sections in files with events.
*/
if (system_Select(fp->bundle, tbuff, LINKUPFILE, NULL, NULL) < 0) {
/*
* XXX: Avoid duplicate evaluation of label between IPCP and
* IPV6CP. When IPCP is enabled and rejected, label is not
* evaluated.
*/
if (bundle_GetLabel(fp->bundle) && !Enabled(fp->bundle, OPT_IPCP)) {
if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
LINKUPFILE, NULL, NULL) < 0)
system_Select(fp->bundle, "MYADDR6", LINKUPFILE, NULL, NULL);
} else
system_Select(fp->bundle, "MYADDR6", LINKUPFILE, NULL, NULL);
}
fp->more.reqs = fp->more.naks = fp->more.rejs = ipv6cp->cfg.fsm.maxreq * 3;
log_DisplayPrompts();
return 1;
}
示例3: BundNcpsUp
static void
BundNcpsUp(Bund b)
{
if (Enabled(&b->conf.options, BUND_CONF_IPCP))
IpcpUp(b);
if (Enabled(&b->conf.options, BUND_CONF_IPV6CP))
Ipv6cpUp(b);
if (Enabled(&b->conf.options, BUND_CONF_COMPRESSION))
CcpUp(b);
if (Enabled(&b->conf.options, BUND_CONF_ENCRYPTION))
EcpUp(b);
}
示例4: ipv6cp_LayerDown
static void
ipv6cp_LayerDown(struct fsm *fp)
{
/* About to come down */
struct ipv6cp *ipv6cp = fsm2ipv6cp(fp);
static int recursing;
char addr[40];
if (!recursing++) {
snprintf(addr, sizeof addr, "%s", ncpaddr_ntoa(&ipv6cp->myaddr));
log_Printf(LogIPV6CP, "%s: LayerDown: %s\n", fp->link->name, addr);
#ifndef NORADIUS
radius_Flush(&fp->bundle->radius);
radius_Account(&fp->bundle->radius, &fp->bundle->radacct6,
fp->bundle->links, RAD_STOP, &ipv6cp->throughput);
/*
* XXX: Avoid duplicate evaluation of filterid between IPCP and
* IPV6CP. When IPCP is enabled and rejected, filterid is not
* evaluated.
*/
if (!Enabled(fp->bundle, OPT_IPCP)) {
if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid)
system_Select(fp->bundle, fp->bundle->radius.filterid, LINKDOWNFILE,
NULL, NULL);
}
#endif
/*
* XXX this stuff should really live in the FSM. Our config should
* associate executable sections in files with events.
*/
if (system_Select(fp->bundle, addr, LINKDOWNFILE, NULL, NULL) < 0) {
/*
* XXX: Avoid duplicate evaluation of label between IPCP and
* IPV6CP. When IPCP is enabled and rejected, label is not
* evaluated.
*/
if (bundle_GetLabel(fp->bundle) && !Enabled(fp->bundle, OPT_IPCP)) {
if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
LINKDOWNFILE, NULL, NULL) < 0)
system_Select(fp->bundle, "MYADDR6", LINKDOWNFILE, NULL, NULL);
} else
system_Select(fp->bundle, "MYADDR6", LINKDOWNFILE, NULL, NULL);
}
ipv6cp_Setup(ipv6cp);
}
recursing--;
}
示例5: SimpleMarkText
/// SimpleMarkText()
static void SimpleMarkText(struct InstData *data, LONG startx, struct line_node *startline, LONG stopx, struct line_node *stopline)
{
ENTER();
if(Enabled(data))
{
data->blockinfo.enabled = FALSE;
MarkText(data, data->blockinfo.startx, data->blockinfo.startline, data->blockinfo.stopx, data->blockinfo.stopline);
}
// else
{
SetCursor(data, data->CPos_X, data->actualline, FALSE);
}
data->blockinfo.startline = startline;
data->blockinfo.startx = startx;
data->blockinfo.stopline = data->actualline = stopline;
data->blockinfo.stopx = data->CPos_X = stopx;
data->blockinfo.enabled = TRUE;
ScrollIntoDisplay(data);
MarkText(data, startx, startline, stopx, stopline);
LEAVE();
}
示例6: VerifySystemPointers
void InverseMuscleCurrent::Load(CStdXml &oXml)
{
VerifySystemPointers();
oXml.IntoElem(); //Into Item Element
m_strID = Std_CheckString(oXml.GetChildString("ID"));
if(Std_IsBlank(m_strID))
THROW_ERROR(Al_Err_lIDBlank, Al_Err_strIDBlank);
m_strName = oXml.GetChildString("Name", "");
//This will add this object to the object list of the simulation.
m_lpSim->AddToObjectList(this);
TargetNodeID(oXml.GetChildString("TargetNodeID"));
AlwaysActive(oXml.GetChildBool("AlwaysActive", m_bAlwaysActive));
Enabled(oXml.GetChildBool("Enabled", m_bEnabled));
MuscleID(oXml.GetChildString("MuscleID", ""));
MuscleLengthData(oXml.GetChildString("LengthData", ""));
Conductance(oXml.GetChildFloat("Conductance", m_fltConductance));
RestPotential(oXml.GetChildFloat("RestPotential", m_fltRestPotential));
oXml.OutOfElem(); //OutOf Simulus Element
}
示例7: tcpmss_Check
static struct mbuf *
tcpmss_Check(struct bundle *bundle, struct mbuf *bp)
{
struct ip *pip;
size_t hlen, plen;
if (!Enabled(bundle, OPT_TCPMSSFIXUP))
return bp;
bp = m_pullup(bp);
plen = m_length(bp);
pip = (struct ip *)MBUF_CTOP(bp);
hlen = pip->ip_hl << 2;
/*
* Check for MSS option only for TCP packets with zero fragment offsets
* and correct total and header lengths.
*/
if (pip->ip_p == IPPROTO_TCP && (ntohs(pip->ip_off) & IP_OFFMASK) == 0 &&
ntohs(pip->ip_len) == plen && hlen <= plen &&
plen >= sizeof(struct tcphdr) + hlen)
MSSFixup((struct tcphdr *)(MBUF_CTOP(bp) + hlen), plen - hlen,
MAXMSS(bundle->iface->mtu));
return bp;
}
示例8: Enabled
void cUIControlAnim::DisableFadeOut( const cTime& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
Enabled( false );
StartAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type );
mControlFlags |= UI_CTRL_FLAG_DISABLE_FADE_OUT;
}
示例9: GetClient
void GColourSelect::OnPaint(GSurface *pDC)
{
GDropDown::OnPaint(pDC);
GRect r = GetClient();
r.x2 -= 14;
r.Size(5, 5);
if (IsOpen()) r.Offset(1, 1);
bool HasColour = Enabled() && c32 != 0;
pDC->Colour(HasColour ? LC_BLACK : LC_LOW, 24);
pDC->Box(&r);
r.Size(1, 1);
pDC->Colour(HasColour ? c32 : Rgb24To32(LC_LOW), 32);
if (HasColour)
{
pDC->Rectangle(&r);
}
else
{
pDC->Line(r.x1, r.y1, r.x2, r.y2);
pDC->Line(r.x1, r.y2, r.x2, r.y1);
}
}
示例10: Enabled
//
// Note: This method is from ViewerToggleAction but was transplanted
// here to ensure that the action was updated. When using the
// immediate base class's Update method the popup menu was not
// updating on some platforms.
//
void
SetToolbarIconSizeActionUI::Update()
{
// Update the action's enabled state.
bool actionShouldBeEnabled = Enabled();
if(action->isEnabled() != actionShouldBeEnabled)
action->setEnabled(actionShouldBeEnabled);
// Update the action's toggled state if it is a toggle action.
if(action->isCheckable())
{
bool actionShouldBeToggled = Checked();
if(toggled != actionShouldBeToggled)
{
// Set the appropriate icon into the action.
if (!GetViewerProperties()->GetNowin() &&
!action->icon().isNull())
{
if(actionShouldBeToggled)
SetIcon(QIcon(*toggledIcon));
else
SetIcon(QIcon(*regularIcon));
}
action->blockSignals(true);
action->setChecked(actionShouldBeToggled);
action->blockSignals(false);
}
toggled = actionShouldBeToggled;
}
}
示例11: CcpConfigure
static void
CcpConfigure(Fsm fp)
{
Bund b = (Bund)fp->arg;
CcpState const ccp = &b->ccp;
int k;
/* Reset state */
ccp->self_reject = 0;
ccp->peer_reject = 0;
ccp->crypt_check = 0;
ccp->xmit = NULL;
ccp->recv = NULL;
for (k = 0; k < CCP_NUM_PROTOS; k++) {
CompType const ct = gCompTypes[k];
if (ct->Configure) {
if ((*ct->Configure)(b)) {
if (Enabled(&ccp->options, k)) {
Log(LG_CCP, ("[%s] CCP: Protocol %s disabled "
"as useless for this setup",
b->name, ct->name));
}
CCP_SELF_REJ(ccp, k);
};
}
}
}
示例12: BundOpenLinks
void
BundOpenLinks(Bund b)
{
int k;
TimerStop(&b->reOpenTimer);
if (Enabled(&b->conf.options, BUND_CONF_BWMANAGE)) {
if (b->n_links != 0)
return;
for (k = 0; k < NG_PPP_MAX_LINKS; k++) {
if (b->links[k]) {
BundOpenLink(b->links[k]);
break;
} else if (b->conf.linkst[k][0]) {
BundCreateOpenLink(b, k);
break;
}
}
} else {
for (k = 0; k < NG_PPP_MAX_LINKS; k++) {
if (b->links[k])
BundOpenLink(b->links[k]);
else if (b->conf.linkst[k][0])
BundCreateOpenLink(b, k);
}
}
}
示例13: Std_CheckString
bool RobotInterface::SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError)
{
std::string strType = Std_CheckString(strDataType);
if(strType == "ENABLED")
{
Enabled(Std_ToBool(strValue));
return true;
}
if(strType == "PHYSICSTIMESTEP")
{
PhysicsTimeStep((float) atof(strValue.c_str()));
return true;
}
if(strType == "SYNCHSIM")
{
SynchSim(Std_ToBool(strValue));
return true;
}
if(AnimatBase::SetData(strType, strValue, false))
return true;
//If it was not one of those above then we have a problem.
if(bThrowError)
THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType, "Data Type", strDataType);
return false;
}
示例14: CoreUpdateList
void CLuaDepScreen::CoreUpdateList()
{
if (!Enabled())
{
Enable(true);
NNCurses::TUI.ActivateGroup(this);
}
m_pTextField->ClearText();
for (TDepList::const_iterator it=GetDepList().begin(); it!=GetDepList().end(); it++)
{
m_pTextField->AddText(CreateText("%s: %s\n", GetTranslation("Name"),
GetTranslation(it->name).c_str()));
if (!it->description.empty())
m_pTextField->AddText(CreateText("%s: %s\n", GetTranslation("Description"),
GetTranslation(it->description).c_str()));
m_pTextField->AddText(CreateText("%s: %s\n\n", GetTranslation("Problem"),
GetTranslation(it->problem).c_str()));
}
if (GetDepList().empty())
m_bClose = true;
}
示例15: Init
void Init()
{
if (!Enabled())
return;
gmlShareLists = configHandler->GetBool("MultiThreadShareLists");
if (!gmlShareLists) {
gmlMaxServerThreadNum = GML_LOAD_THREAD_NUM;
gmlMaxShareThreadNum = GML_LOAD_THREAD_NUM;
gmlNoGLThreadNum = GML_SIM_THREAD_NUM;
}
gmlThreadCountOverride = configHandler->GetInt("MultiThreadCount");
gmlThreadCount = GML_CPU_COUNT;
if (gmlShareLists) { // create offscreen OpenGL contexts
for (int i = 0; i < gmlThreadCount; ++i)
ogc[i] = new COffscreenGLContext();
}
gmlProcessor = new gmlClientServer<void, int, CUnit*>;
#if GML_ENABLE_SIM
gmlMultiThreadSim = configHandler->GetBool("MultiThreadSim");
gmlKeepRunning = true;
gmlStartSim = false;
// start sim thread
gmlProcessor->AuxWork(&gmlSimLoop, NULL);
#endif
}