当前位置: 首页>>代码示例>>C++>>正文


C++ SmartPointer::IsNull方法代码示例

本文整理汇总了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());
 }
开发者ID:praveenster,项目名称:leplib,代码行数:7,代码来源:TestStringBuilder.cpp

示例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;
}
开发者ID:paulcm,项目名称:MITK,代码行数:29,代码来源:berryCommandService.cpp

示例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.");
  }
}
开发者ID:151706061,项目名称:MITK,代码行数:25,代码来源:berryCommandParameter.cpp

示例4: add_by

		static void add_by (SmartPointer<Client> client, ChatMessage & message) {
		
			if (!client.IsNull()) message << String::Format(
				by,
				client->GetUsername()
			);
		
		}
开发者ID:HalfDemon,项目名称:MCPP,代码行数:8,代码来源:command.cpp

示例5: ctkInvalidArgumentException

ParameterValueConverterProxy::ParameterValueConverterProxy(
    const SmartPointer<IConfigurationElement>& converterConfigurationElement)
  : converterConfigurationElement(converterConfigurationElement)
{
  if (converterConfigurationElement.IsNull())
  {
    throw ctkInvalidArgumentException(
        "converterConfigurationElement must not be null");
  }
}
开发者ID:151706061,项目名称:MITK,代码行数:10,代码来源:berryParameterValueConverterProxy.cpp

示例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));
}
开发者ID:ghisvail,项目名称:MITK,代码行数:11,代码来源:berryAbstractHandlerWithState.cpp

示例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);
}
开发者ID:151706061,项目名称:MITK,代码行数:14,代码来源:berryContributionRoot.cpp

示例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));
}
开发者ID:151706061,项目名称:MITK,代码行数:14,代码来源:berryRegistryObjectReferenceMap.cpp

示例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;
}
开发者ID:Cymatium,项目名称:MITK,代码行数:18,代码来源:berryCommandContributionItem.cpp

示例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;
    }
  }
}
开发者ID:151706061,项目名称:MITK,代码行数:19,代码来源:berryEditorHistory.cpp


注:本文中的SmartPointer::IsNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。