本文整理汇总了C++中setNodeType函数的典型用法代码示例。如果您正苦于以下问题:C++ setNodeType函数的具体用法?C++ setNodeType怎么用?C++ setNodeType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setNodeType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setNodeType
void TypeCheckerVisitor::visitReturnNode(ReturnNode* node) {
if (node->returnExpr()) {
node->returnExpr()->visit(this);
setNodeType(node, getNodeType(node->returnExpr()));
} else {
setNodeType(node, VT_VOID);
}
}
示例2: checkForSymbol
UTI NodeConstant::checkAndLabelType()
{
UTI it = Nav;
bool stubcopy = m_state.isClassAStub(m_state.getCompileThisIdx());
//instantiate, look up in class block; skip if stub copy and already ready.
if(!stubcopy && m_constSymbol == NULL)
checkForSymbol();
else
{
stubcopy = m_state.hasClassAStub(m_state.getCompileThisIdx()); //includes ancestors
}
if(m_constSymbol)
{
it = m_constSymbol->getUlamTypeIdx();
}
else if(isReadyConstant() && stubcopy)
{
assert(m_state.okUTItoContinue(m_constType));
setNodeType(m_constType); //t3565, t3640, t3641, t3642, t3652
//stub copy case: still wants uti mapping
it = NodeTerminal::checkAndLabelType();
}
else if(stubcopy)
{
// still need its symbol for a value
// use the member class (unlike checkForSymbol)
}
// map incomplete UTI
if(!m_state.isComplete(it)) //reloads to recheck
{
std::ostringstream msg;
msg << "Incomplete " << prettyNodeName().c_str() << " for type: ";
msg << m_state.getUlamTypeNameBriefByIndex(it).c_str();
msg << ", used with constant symbol name '";
msg << m_state.getTokenDataAsString(m_token).c_str() << "'";
MSG(getNodeLocationAsString().c_str(), msg.str().c_str(), WAIT);
//wait until updateConstant tried.
}
setNodeType(it);
Node::setStoreIntoAble(TBOOL_FALSE);
//copy m_constant from Symbol into NodeTerminal parent.
if(!isReadyConstant())
m_ready = updateConstant(); //sets ready here
if(!isReadyConstant())
{
it = Hzy;
if(!stubcopy)
m_constSymbol = NULL; //lookup again too! (e.g. inherited template instances)
m_state.setGoAgain();
}
return it;
} //checkAndLabelType
示例3: indexFirstAlnum
int SHMParser::generateTree(SHMList<SHMString> list, int pos, SHMTreeNode* &root, bool first) {
if (pos > list.size()) return -1;
if (!root) return -1;
int depth = 0;
int i = 0;
if (first) {
root->setNodeType("fileRoot");
} else {
depth = indexFirstAlnum(list[pos]);
root->setLineContents(list[pos].substr(depth));
setNodeFamily(root);
setNodeType(root);
setNodeLineNumbers(root);
setNodeAttributes(root);
i = pos+1;
}
while (i<list.size()) {
int nextDepth = indexFirstAlnum(list[i]);
if (nextDepth > depth) {
SHMTreeNode *nextSon = new SHMTreeNode();
nextSon->setLineStart(root->lineStart());
nextSon->setLineEnd(root->lineEnd());
i = generateTree(list, i,nextSon,false);
root->appendChild(nextSon);
} else {
break;
}
}
return i;
}
示例4: MSG
UlamValue NodeBinaryOpArithDivide::makeImmediateBinaryOp(UTI type, u32 ldata, u32 rdata, u32 len)
{
UlamValue rtnUV;
if(rdata == 0)
{
MSG(getNodeLocationAsString().c_str(), "Possible Divide By Zero Attempt", ERR);
rtnUV.setUlamValueTypeIdx(Nav);
setNodeType(Nav); //compiler counts
return rtnUV;
}
ULAMTYPE typEnum = m_state.getUlamTypeByIndex(type)->getUlamTypeEnum();
switch(typEnum)
{
case Int:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideInt32(ldata, rdata, len), len);
break;
case Unsigned:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideUnsigned32(ldata, rdata, len), len);
break;
case Bool:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideBool32(ldata, rdata, len), len);
break;
case Unary:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideUnary32(ldata, rdata, len), len);
break;
case Bits:
default:
m_state.abortUndefinedUlamPrimitiveType();
break;
};
return rtnUV;
} //makeImmediateBinaryOp
示例5: AudioBasicInspectorNode
AnalyserNode::AnalyserNode(AudioContext* context, float sampleRate)
: AudioBasicInspectorNode(context, sampleRate, 2)
{
ScriptWrappable::init(this);
setNodeType(NodeTypeAnalyser);
initialize();
}
示例6: MSG
UlamValue NodeBinaryOpArithRemainder::makeImmediateLongBinaryOp(UTI type, u64 ldata, u64 rdata, u32 len)
{
UlamValue rtnUV;
if(rdata == 0)
{
MSG(getNodeLocationAsString().c_str(), "Possible Division By Zero Attempt in Modulus", ERR);
rtnUV.setUlamValueTypeIdx(Nav);
setNodeType(Nav); //compiler counts
return rtnUV;
}
ULAMTYPE typEnum = m_state.getUlamTypeByIndex(type)->getUlamTypeEnum();
switch(typEnum)
{
case Int:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModInt64(ldata, rdata, len), len);
break;
case Unsigned:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModUnsigned64(ldata, rdata, len), len);
break;
case Bool:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModBool64(ldata, rdata, len), len);
break;
case Unary:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModUnary64(ldata, rdata, len), len);
break;
case Bits:
default:
assert(0);
break;
};
return rtnUV;
} //makeImmediateLongBinaryOp
示例7: AudioBasicProcessorNode
BiquadFilterNode::BiquadFilterNode(AudioContext* context, float sampleRate)
: AudioBasicProcessorNode(context, sampleRate)
{
// Initially setup as lowpass filter.
m_processor = std::move(std::unique_ptr<WebCore::AudioProcessor>(new BiquadProcessor(context, sampleRate, 1, false)));
setNodeType(NodeTypeBiquadFilter);
}
示例8: setFlag
Node::Node(const ZbProperty_t &zbProperty, Topology *topology)
{
setFlag(ItemIsMovable);
setFlag(ItemIsSelectable);
setFlag(ItemSendsGeometryChanges);
setCacheMode(DeviceCoordinateCache);
startColor.setRgba(qRgba(0, 255, 255, 255));
stopColor.setRgba(qRgba(0, 168, 168, 255));
statue = 0; //表示可移动状态
blinkStatue = 0; //表示节点没有闪烁
blinkTimer = new QTimer;
connect(blinkTimer, SIGNAL(timeout()), this, SLOT(onBlink()));
pressTimer = new QTimer(this);
connect(pressTimer, SIGNAL(timeout()), this, SLOT(onPressTimeout()));
myTopology = topology;
setText(converSensorName(ZigbeeIOClass::sensorName[zbProperty.sensorType]));
setNodeType(zbProperty.deviceType);
setZbProperty(zbProperty);
pressStaue = 0;
board = NULL;
}
示例9: region_alloc
FunctionDesc *newExternalFD(Node *type, Region *r) {
FunctionDesc *desc = (FunctionDesc *) region_alloc(r, sizeof(FunctionDesc));
memset(desc, 0, sizeof(FunctionDesc));
desc->exprType = type;
setNodeType(desc, N_FD_EXTERNAL);
return desc;
}
示例10: newRes
Res* newRes(Region *r) {
Res *res1 = (Res *) region_alloc(r,sizeof (Res));
memset(res1, 0, sizeof(Res));
setNodeType(res1, N_VAL);
setIOType(res1, IO_TYPE_INPUT);
return res1;
}
示例11: MSG
UTI NodeBinaryOpEqualArith::checkAndLabelType()
{
UTI nodeType = NodeBinaryOpEqual::checkAndLabelType();
UlamType * nut = m_state.getUlamTypeByIndex(nodeType);
// common part of name
ULAMTYPE enodetyp = nut->getUlamTypeEnum();
if(enodetyp == Bits)
{
// can happen with op-equal operations when both sides are the same type
MSG(getNodeLocationAsString().c_str(), "Arithmetic Operations are invalid on 'Bits' type", ERR);
nodeType = Nav;
}
if(enodetyp == Bool)
{
// can happen with op-equal operations when both sides are the same type
MSG(getNodeLocationAsString().c_str(), "Arithmetic Operations are invalid on 'Bool' type", ERR);
nodeType = Nav;
}
if((nodeType != Nav) && !nut->isScalar())
{
std::ostringstream msg;
msg << "Non-scalars require a loop for operator" << getName();
MSG(getNodeLocationAsString().c_str(), msg.str().c_str(), ERR);
nodeType = Nav;
}
setNodeType(nodeType);
return nodeType;
} //checkAndLabelType
示例12: AudioNode
PannerNode::PannerNode(AudioContext* context, float sampleRate)
: AudioNode(context, sampleRate)
, m_panningModel(Panner::PanningModelHRTF)
, m_distanceModel(DistanceEffect::ModelInverse)
, m_position(0, 0, 0)
, m_orientation(1, 0, 0)
, m_velocity(0, 0, 0)
, m_isAzimuthElevationDirty(true)
, m_isDistanceConeGainDirty(true)
, m_isDopplerRateDirty(true)
, m_lastGain(-1.0)
, m_cachedAzimuth(0)
, m_cachedElevation(0)
, m_cachedDistanceConeGain(1.0f)
, m_cachedDopplerRate(1)
, m_connectionCount(0)
{
// Load the HRTF database asynchronously so we don't block the Javascript thread while creating the HRTF database.
// The HRTF panner will return zeroes until the database is loaded.
m_hrtfDatabaseLoader = HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(context->sampleRate());
ScriptWrappable::init(this);
addInput();
addOutput(AudioNodeOutput::create(this, 2));
// Node-specific default mixing rules.
m_channelCount = 2;
m_channelCountMode = ClampedMax;
m_channelInterpretation = AudioBus::Speakers;
setNodeType(NodeTypePanner);
initialize();
}
示例13: AudioBasicProcessorNode
BiquadFilterNode::BiquadFilterNode(AudioContext* context, float sampleRate)
: AudioBasicProcessorNode(context, sampleRate)
{
// Initially setup as lowpass filter.
m_processor = adoptPtr(new BiquadProcessor(context, sampleRate, 1, false));
setNodeType(NodeTypeBiquadFilter);
}
示例14: ComTdbDDL
///////////////////////////////////////////////////////////////////////////
//
// Methods for class ComTdbDDL
//
///////////////////////////////////////////////////////////////////////////
ComTdbDDLwithStatus::ComTdbDDLwithStatus(char * ddl_query,
ULng32 ddl_querylen,
Int16 ddl_querycharset,
char * schemaName,
ULng32 schemaNameLen,
ex_expr * input_expr,
ULng32 input_rowlen,
ex_expr * output_expr,
ULng32 output_rowlen,
ex_cri_desc * work_cri_desc,
const unsigned short work_atp_index,
ex_cri_desc * given_cri_desc,
ex_cri_desc * returned_cri_desc,
queue_index down,
queue_index up,
Lng32 num_buffers,
ULng32 buffer_size)
: ComTdbDDL(ddl_query, ddl_querylen, ddl_querycharset,
schemaName, schemaNameLen,
input_expr, input_rowlen,
output_expr, output_rowlen,
work_cri_desc, work_atp_index,
given_cri_desc, returned_cri_desc,
down, up,
num_buffers, buffer_size),
flags2_(0)
{
setNodeType(ComTdb::ex_DDL_WITH_STATUS);
}
示例15: ComTdbGenericUtil
///////////////////////////////////////////////////////////////////////////
//
// Methods for class ComTdbDDL
//
///////////////////////////////////////////////////////////////////////////
ComTdbDDL::ComTdbDDL(char * ddl_query,
ULng32 ddl_querylen,
Int16 ddl_querycharset,
char * schemaName,
ULng32 schemaNameLen,
ex_expr * input_expr,
ULng32 input_rowlen,
ex_expr * output_expr,
ULng32 output_rowlen,
ex_cri_desc * work_cri_desc,
const unsigned short work_atp_index,
ex_cri_desc * given_cri_desc,
ex_cri_desc * returned_cri_desc,
queue_index down,
queue_index up,
Lng32 num_buffers,
ULng32 buffer_size)
: ComTdbGenericUtil(ddl_query, ddl_querylen, ddl_querycharset, schemaName, schemaNameLen,
input_expr, input_rowlen,
output_expr, output_rowlen,
work_cri_desc, work_atp_index,
given_cri_desc, returned_cri_desc,
down, up,
num_buffers, buffer_size),
flags_(0)
{
setNodeType(ComTdb::ex_DDL);
memset(fillersComTdbDDL_, sizeof(fillersComTdbDDL_), 0);
}