本文整理汇总了C++中ParameterList::length方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::length方法的具体用法?C++ ParameterList::length怎么用?C++ ParameterList::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList::length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
sp::AreFunctionTypesEqual(FunctionType *a, FunctionType *b)
{
FunctionSignature *af = a->signature();
FunctionSignature *bf = b->signature();
if (!AreTypesEquivalent(af->returnType().resolved(),
bf->returnType().resolved(),
Qualifiers::None))
{
return false;
}
ParameterList *ap = af->parameters();
ParameterList *bp = bf->parameters();
if (ap->length() != bp->length())
return false;
for (size_t i = 0; i < ap->length(); i++) {
VarDecl *arga = ap->at(i);
VarDecl *argb = bp->at(i);
if (!AreTypesEquivalent(arga->te().resolved(),
argb->te().resolved(),
Qualifiers::None))
{
return false;
}
}
return true;
}
示例2: send_frag
bool send_frag(const OpenDDS::DCPS::EntityId_t& writer, CORBA::ULong i,
const SequenceNumber_t& seq, const ACE_INET_Addr& send_to)
{
static const CORBA::ULong N = 3; // number of fragments to send
ParameterList inlineQoS;
if (i == 0) {
inlineQoS.length(1);
inlineQoS[0].string_data("my_topic_name");
inlineQoS[0]._d(PID_TOPIC_NAME);
}
#ifdef __SUNPRO_CC
DataFragSubmessage df;
df.smHeader.submessageId = DATA_FRAG;
df.smHeader.flags = FLAG_E | (i ? 0 : FLAG_Q);
df.smHeader.submessageLength = 0;
df.extraFlags = 0;
df.octetsToInlineQos = DATA_FRAG_OCTETS_TO_IQOS;
df.readerId = ENTITYID_UNKNOWN;
df.writerId = writer;
df.writerSN = seq;
df.fragmentStartingNum.value = i + 1;
df.fragmentsInSubmessage = 1;
df.fragmentSize = FRAG_SIZE;
df.sampleSize = N * FRAG_SIZE;
df.inlineQos = inlineQoS;
#else
const DataFragSubmessage df = {
{DATA_FRAG, CORBA::Octet(FLAG_E | (i ? 0 : FLAG_Q)), 0},
0, DATA_FRAG_OCTETS_TO_IQOS, ENTITYID_UNKNOWN, writer, seq,
{i + 1}, // fragmentStartingNum
1, // fragmentsInSubmessage
FRAG_SIZE, // fragmentSize (smallest fragmentSize allowed is 1KB)
N * FRAG_SIZE, // sampleSize
inlineQoS
};
#endif
size_t size = 0, padding = 0;
gen_find_size(hdr_, size, padding);
gen_find_size(df, size, padding);
size += FRAG_SIZE;
ACE_Message_Block mb(size + padding);
Serializer ser(&mb, host_is_bigendian, Serializer::ALIGN_CDR);
const ACE_CDR::ULong encap = 0x00000100; // {CDR_LE, options} in LE format
bool ok = (ser << hdr_) && (ser << df);
if (i == 0) ok &= (ser << encap);
ok &= ser.write_octet_array(data_for_frag_,
i ? FRAG_SIZE : FRAG_SIZE - 4);
if (!ok) {
ACE_DEBUG((LM_DEBUG, "ERROR: failed to serialize data frag %d\n", i));
return false;
}
return send(mb, send_to);
}