本文整理汇总了C++中Members类的典型用法代码示例。如果您正苦于以下问题:C++ Members类的具体用法?C++ Members怎么用?C++ Members使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Members类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSON_ASSERT
Value::Members
Value::getMemberNames () const
{
JSON_ASSERT ( type_ == nullValue || type_ == objectValue );
if ( type_ == nullValue )
return Value::Members ();
Members members;
members.reserve ( value_.map_->size () );
#ifndef JSON_VALUE_USE_INTERNAL_MAP
ObjectValues::const_iterator it = value_.map_->begin ();
ObjectValues::const_iterator itEnd = value_.map_->end ();
for ( ; it != itEnd; ++it )
members.push_back ( std::string ( (*it).first.c_str () ) );
#else
ValueInternalMap::IteratorState it;
ValueInternalMap::IteratorState itEnd;
value_.map_->makeBeginIterator ( it );
value_.map_->makeEndIterator ( itEnd );
for ( ; !ValueInternalMap::equals ( it, itEnd ); ValueInternalMap::increment (it) )
members.push_back ( std::string ( ValueInternalMap::key ( it ) ) );
#endif
return members;
}
示例2: main
int main()
{
Members const constObject;
Members nonConstObject;
constObject.member();
nonConstObject.member();
}
示例3: add_component
void add_component(Members const& xs, Graph& g) {
using namespace boost;
for (std::size_t i = 0; i < xs.size(); ++i) {
for (std::size_t j = i + 1; j < xs.size(); ++j) {
add_edge(xs[i], xs[j], g);
}
}
}
示例4: ConvertSatoshisToBitcoin
void BtcTxTarget::ConvertSatoshisToBitcoin()
{
Members targetAddresses = this->getMemberNames();
for (Json::Value::ArrayIndex i = 0; i < targetAddresses.size(); i++)
{
(*this)[targetAddresses[i]] = BtcHelper::SatoshisToCoins(
(*this)[targetAddresses[i]].asInt64());
}
}
示例5: lock
void Configuration::keys(std::vector<std::string>& keys, const std::string& baseKey)
{
Mutex::ScopedLock lock(_mutex);
Members members = this->getMemberNames();
for (unsigned i = 0; i < members.size(); i++) {
if (members[i].find(baseKey) != std::string::npos)
keys.push_back(members[i]);
}
}
示例6: JSON_ASSERT_MESSAGE
Value::Members Value::getMemberNames() const {
JSON_ASSERT_MESSAGE(
type() == nullValue || type() == objectValue,
"in Json::Value::getMemberNames(), value must be objectValue");
if (type() == nullValue)
return Value::Members();
Members members;
members.reserve(value_.map_->size());
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
for (; it != itEnd; ++it) {
members.push_back(String((*it).first.data(), (*it).first.length()));
}
return members;
}
示例7: JSON_ASSERT
Value::Members
Value::getMemberNames() const
{
JSON_ASSERT( type_ == nullValue || type_ == objectValue );
if ( type_ == nullValue )
return Value::Members();
Members members;
members.reserve( value_.map_->size() );
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
for ( ; it != itEnd; ++it )
members.push_back( std::string( (*it).first.c_str() ) );
return members;
}
示例8: _FindVariable
std::string Class::GetBaseClassName(std::string ClassName, std::string MemberName)
{
Members oMembers;
if (Class::GetMembers(ClassName, oMembers))
{
std::list< std::pair<std::string, Access::Variable> >::iterator it;
it = _FindVariable(oMembers.GetVariableMap(), MemberName);
if (it != oMembers.GetVariableMap().end())
{
Variable V = (*it).second;
return (*it).second.sClassname;
}
}
return std::string();
}
示例9: main
int main() {
#if 0
SipProtocol protocol;
protocol.buildRequestHeader("[email protected]", //user
"192.168.80.111", //from
"192.168.80.125", //to
"192.168.80.125", //via
"1" , //cseq
"qega444afa4g6aga4g"//call-id
);
waitForCall(&protocol);
protocol.dumpProperties();
#endif
DisableCompare<CppString> discom;
Members val;
val.insert(pair<CppString, int>("key1", 1));
val.insert(pair<CppString, int>("key2", 2));
Members::iterator iter;
for(iter = val.begin(); iter != val.end(); iter++) {
cout << iter->first << endl;
}
}
示例10: requiredAttributeChanged
void RadioButtonGroup::requiredAttributeChanged(HTMLInputElement* button) {
DCHECK_EQ(button->type(), InputTypeNames::radio);
auto it = m_members.find(button);
DCHECK_NE(it, m_members.end());
bool wasValid = isValid();
// Synchronize the 'required' flag for the button, along with
// updating the overall count.
updateRequiredButton(*it, button->isRequired());
if (wasValid != isValid())
setNeedsValidityCheckForAllButtons();
}
示例11: remove
void RadioButtonGroup::remove(HTMLInputElement* button) {
DCHECK_EQ(button->type(), InputTypeNames::radio);
auto it = m_members.find(button);
if (it == m_members.end())
return;
bool wasValid = isValid();
DCHECK_EQ(it->value, button->isRequired());
updateRequiredButton(*it, false);
m_members.remove(it);
if (m_checkedButton == button)
m_checkedButton = nullptr;
if (m_members.isEmpty()) {
DCHECK(!m_requiredCount);
DCHECK(!m_checkedButton);
} else if (wasValid != isValid()) {
setNeedsValidityCheckForAllButtons();
}
if (!wasValid) {
// A radio button not in a group is always valid. We need to make it
// valid only if the group was invalid.
button->setNeedsValidityCheck();
}
// Send notification to update AX attributes for AXObjects which radiobutton
// group has.
if (!m_members.isEmpty()) {
HTMLInputElement* input = m_members.begin()->key;
if (AXObjectCache* cache = input->document().existingAXObjectCache())
cache->radiobuttonRemovedFromGroup(input);
}
}
示例12: updateCheckedState
void RadioButtonGroup::updateCheckedState(HTMLInputElement* button) {
DCHECK_EQ(button->type(), InputTypeNames::radio);
DCHECK(m_members.contains(button));
bool wasValid = isValid();
if (button->checked()) {
setCheckedButton(button);
} else {
if (m_checkedButton == button)
m_checkedButton = nullptr;
}
if (wasValid != isValid())
setNeedsValidityCheckForAllButtons();
for (auto& member : m_members) {
HTMLInputElement* const inputElement = member.key;
inputElement->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
}
}
示例13: add
void RadioButtonGroup::add(HTMLInputElement* button) {
DCHECK_EQ(button->type(), InputTypeNames::radio);
auto addResult = m_members.add(button, false);
if (!addResult.isNewEntry)
return;
bool groupWasValid = isValid();
updateRequiredButton(*addResult.storedValue, button->isRequired());
if (button->checked())
setCheckedButton(button);
bool groupIsValid = isValid();
if (groupWasValid != groupIsValid) {
setNeedsValidityCheckForAllButtons();
} else if (!groupIsValid) {
// A radio button not in a group is always valid. We need to make it
// invalid only if the group is invalid.
button->setNeedsValidityCheck();
}
}
示例14: size
unsigned RadioButtonGroup::size() const {
return m_members.size();
}
示例15: contains
bool RadioButtonGroup::contains(HTMLInputElement* button) const {
return m_members.contains(button);
}