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


C++ NodePtr::GetFullName方法代码示例

本文整理汇总了C++中NodePtr::GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::GetFullName方法的具体用法?C++ NodePtr::GetFullName怎么用?C++ NodePtr::GetFullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NodePtr的用法示例。


在下文中一共展示了NodePtr::GetFullName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Define

void AnnotationDefinition::Define(NodePtr node, TypeCode type, const ReasonPtr & reason)
{
	ElementPtr member = node->GetElement();
	if (!!member)
	{
		AnnotationDefinitionPtr existingDef = boost::dynamic_pointer_cast<AnnotationDefinition>(member);
		if (!existingDef)
		{
			std::stringstream ss;
			ss << "Attempt to define previously defined Node "
				<< node->GetFullName()
				<< " as an Annotation.";
			throw ModelInconsistencyException(existingDef->GetReasonCreated(),
				reason,
				ss.str());
		}
		else
		{
			if (existingDef->GetTypeCode() == type)
			{
				// Phew! Old def is the same as this one.
				return;
			}
			std::stringstream ss;
			ss << "Attempt to redefine Annotation "
				<< node->GetFullName()
				<< " with value type of "
				<< existingDef->GetAnnotationTypeName()
				<< " as value type "
				<< getAnnotationTypeName(type);
			throw ModelInconsistencyException(existingDef->GetReasonCreated(),
				reason,
				ss.str());
		}
	} // end !!member
	Create(node, type, reason);

}
开发者ID:TimSimpson,项目名称:Macaroni,代码行数:38,代码来源:AnnotationDefinition.cpp

示例2: Index

int NodeLuaMetaData::Index(lua_State * L, NodePtr & ptr, const std::string & index)
{
	/*if (index == "FindOrCreateClass")
	{
		lua_pushcfunction(L, NodeLuaFunctions::FindOrCreateClass);
		return 1;
	}
	else if (index == "FindOrCreateNamespace")
	{
		lua_pushcfunction(L, NodeLuaFunctions::FindOrCreateNamespace);
		return 1;
	}
	else*/
	if (index == "AdoptedHome")
	{
		NodePtr adoptedHome = ptr->GetAdoptedHome();
		if (!adoptedHome)
		{
			lua_pushnil(L);
		} else
		{
			NodeLuaMetaData::PutInstanceOnStack(L, adoptedHome);
		}
	}
	else if (index == "Annotations")
	{
		AnnotationTable & table = ptr->GetAnnotations();
		AnnotationTablePtr tPtr(&table);
		AnnotationTableLuaMetaData::PutInstanceOnStack(L, tPtr);
	}
	else if (index == "Find")
	{
		lua_pushcfunction(L, NodeLuaFunctions::Find);
		return 1;
	}
	else if (index == "FindOrCreate")
	{
		lua_pushcfunction(L, NodeLuaFunctions::FindOrCreate);
		return 1;
	}
	else if (index == "FullName")
	{
		lua_pushlstring(L, ptr->GetFullName().c_str(), ptr->GetFullName().size());
	}
	else if (index == "GetOperatorName")
	{
		lua_pushcfunction(L, NodeLuaFunctions::GetOperatorName);
	}
	else if (index == "GetPrettyFullName")
	{
		lua_pushcfunction(L, NodeLuaFunctions::PrettyFullName);
	}
	else if (index == "HFilePath")
	{
		FileNamePtr fileName = ptr->GetHFilePath();
		if (!fileName)
		{
			lua_pushnil(L);
		}
		else
		{
			FileNameLuaMetaData::PutInstanceOnStack(L, ptr->GetHFilePath());
		}
	}
	else if (index == "IsOperator")
	{
		lua_pushboolean(L, ptr->IsOperator());
	}
	else if (index == "IsRoot")
	{
		lua_pushboolean(L, ptr->IsRoot());
		return 1;
	}
	else if (index == "Children")
	{
		// Put a lua pointer for this Node object on the Lua stack,
		// but associate it with a different meta table.
		createNodePtrUserData(L, ptr);
		luaL_getmetatable(L, MEMBERSPROPERTY_METATABLENAME);
		lua_setmetatable(L, -2);
		return 1;
	}
	else if (index == "Element")
	{
		ElementLuaMetaData::PutInstanceOnStack(L, ptr->GetElement());
	}
	else if (index == "Member")
	{
		ElementLuaMetaData::PutInstanceOnStack(L, ptr->GetElement());
		//return luaL_error(L,
		//	"Member is the old name, please switch to \"Element\".");
	}
	else if (index == "Name")
	{
		lua_pushlstring(L, ptr->GetName().c_str(), ptr->GetName().length());
	}
	else if (index == "Node")
	{
		NodePtr scope = ptr->GetNode();
		NodeLuaMetaData::PutInstanceOnStack(L, scope);
//.........这里部分代码省略.........
开发者ID:bowlofstew,项目名称:Macaroni,代码行数:101,代码来源:NodeLua.cpp


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