本文整理汇总了C++中SmartPointer::IsNull方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPointer::IsNull方法的具体用法?C++ SmartPointer::IsNull怎么用?C++ SmartPointer::IsNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPointer
的用法示例。
在下文中一共展示了SmartPointer::IsNull方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
bool test()
{
StringBuilder sb;
sb.Append("qwerty asdfgh");
SmartPointer<String> s = sb.Substring(-2, -1);
return (s.IsNull());
}
示例2: NotDefinedException
SmartPointer<IElementReference> CommandService::RegisterElementForCommand(
const SmartPointer<ParameterizedCommand>& command,
const SmartPointer<UIElement>& element)
{
if (!command->GetCommand()->IsDefined())
{
throw NotDefinedException(
"Cannot define a callback for undefined command "
+ command->GetCommand()->GetId());
}
if (element.IsNull())
{
throw NotDefinedException("No callback defined for command "
+ command->GetCommand()->GetId());
}
QHash<QString, QString> paramMap = command->GetParameterMap();
QHash<QString, Object::Pointer> parms;
for (QHash<QString, QString>::const_iterator i = paramMap.begin();
i != paramMap.end(); ++i)
{
Object::Pointer value(new ObjectString(i.value()));
parms.insert(i.key(), value);
}
IElementReference::Pointer ref(new ElementReference(command->GetId(),
element, parms));
RegisterElement(ref);
return ref;
}
示例3: ctkInvalidArgumentException
CommandParameter::CommandParameter(const QString& id, const QString& name,
const SmartPointer<IConfigurationElement>& values,
const SmartPointer<ParameterType>& parameterType,
const bool optional)
: name(name)
, optional(optional)
, parameterType(parameterType)
, valuesConfigurationElement(values)
, id(id)
{
if (id.isNull())
{
throw ctkInvalidArgumentException("Cannot create a parameter with a null id");
}
if (name.isNull())
{
throw ctkInvalidArgumentException("The name of a parameter cannot be null.");
}
if (values.IsNull())
{
throw ctkInvalidArgumentException("The values for a parameter cannot be null.");
}
}
示例4: add_by
static void add_by (SmartPointer<Client> client, ChatMessage & message) {
if (!client.IsNull()) message << String::Format(
by,
client->GetUsername()
);
}
示例5: ctkInvalidArgumentException
ParameterValueConverterProxy::ParameterValueConverterProxy(
const SmartPointer<IConfigurationElement>& converterConfigurationElement)
: converterConfigurationElement(converterConfigurationElement)
{
if (converterConfigurationElement.IsNull())
{
throw ctkInvalidArgumentException(
"converterConfigurationElement must not be null");
}
}
示例6: AddState
void AbstractHandlerWithState::AddState(const QString& stateId, const SmartPointer<State>& state)
{
if (state.IsNull())
{
throw ctkInvalidArgumentException("Cannot add a null state");
}
states.insert(stateId, state);
state->AddListener(this);
HandleStateChange(state, Object::Pointer(0));
}
示例7: RegisterVisibilityForChild
void ContributionRoot::RegisterVisibilityForChild(const SmartPointer<IContributionItem>& item,
const SmartPointer<Expression>& visibleWhen)
{
if (item.IsNull())
throw std::invalid_argument("item must not be null");
Expression::Pointer visibleWhenTmp = visibleWhen;
if (visibleWhenTmp.IsNull())
visibleWhenTmp = AlwaysEnabledExpression::INSTANCE;
menuService->RegisterVisibleWhen(item, visibleWhenTmp, restriction,
CreateIdentifierId(item));
itemsToExpressions.append(item);
}
示例8: Put
void RegistryObjectReferenceMap::Put(int key, const SmartPointer<RegistryObject>& value)
{
if (value.IsNull())
throw ctkInvalidArgumentException("null values not allowed");
Purge();
ReferenceMapType::Iterator i = references.find(key);
if (i != references.end())
{
delete *i;
}
references.insert(key, NewEntry(value));
}
示例9: ShouldRestoreAppearance
bool CommandContributionItem::ShouldRestoreAppearance(const SmartPointer<IHandler>& handler)
{
// if no handler or handler doesn't implement IElementUpdater,
// restore the contributed elements
if (handler.IsNull())
return true;
if (!(handler.Cast<IElementUpdater>()))
return true;
// special case, if its HandlerProxy, then check the actual handler
// if (handler instanceof HandlerProxy) {
// HandlerProxy handlerProxy = (HandlerProxy) handler;
// IHandler actualHandler = handlerProxy.getHandler();
// return shouldRestoreAppearance(actualHandler);
// }
return false;
}
示例10: Remove
void EditorHistory::Remove(const SmartPointer<IEditorInput>& input)
{
if (input.IsNull())
{
return;
}
auto iter = fifoList.begin();
while (iter != fifoList.end())
{
if ((*iter)->Matches(input))
{
iter = fifoList.erase(iter);
}
else
{
++iter;
}
}
}