Ejemplo n.º 1
0
bool MPSegment::build_DAG( string &sentence, SegmentContext &segContext )
{
    // 初始化每个char节点
    vector<char>    vecLen; 
    size_t          char_count;

    Utf8_LetterLen( sentence, vecLen );
    char_count  = vecLen.size();


    // 构建每个节点DAG
    size_t          i(0), j(0), k(0);
    size_t          start_pos(0), next_pos(0), num(0);
    STWordInfo      wInfo;
    STCharNodeInfo  *pNode(NULL);
    STResultPair    result_pair[20];
    const char      *pSz = sentence.c_str();
    

    segContext.clear();
    segContext.resize( char_count );
    for ( i=0; i<char_count; ++i )
    {
        //cout<< "build dag " << i << "\tstart_pos: "<< start_pos<< "\tcharlen: "<< int(vecLen[i]) << endl;
        pNode = &segContext[i];
        pNode->ch = sentence.substr( start_pos, int(vecLen[i]) );

        num = m_pDict->commonPrefixSearch( pSz+start_pos, result_pair, 20 );
        for ( j=0; j<num; ++j )
        {
            //cout << "common search: "<< i << "\t" << result_pair[j].len << "\t" << result_pair[j].val << endl;

            for ( k=i; k<char_count; ++k )
            {
                result_pair[j].len -= vecLen[k]; 
                if ( 0 == result_pair[j].len )
                    break;
            }

            m_pDict->getWordInfo( result_pair[j].val, pNode->dag[k+1] );
        }
        
    
        // single char, assign the min weight
        wInfo.clear();
        wInfo.word      = pNode->ch;
        wInfo.freq      = m_pDict->getMinFreq( );
        wInfo.logFreq   = m_pDict->getMinLogFreq( );
        pNode->dag[i+1] = wInfo;

        start_pos += vecLen[i];
    }


    return true;    
}
Ejemplo n.º 2
0
PeerNodePtr PeerNode::CreatePeerNode(int peerId, std::string ipAddress, int port)
{
	PeerNodePtr pNode(new PeerNode);
	pNode->SetPort(port);
	pNode->SetListenPort(port);
	pNode->SetIpAddr(ipAddress);
	pNode->SetPeerId(peerId);
	pNode->Init();

	PeerPtr pPeer = Peer::GetPeer();
	pPeer->AddPeerNode(pNode);

	return pNode;
}
Ejemplo n.º 3
0
    void Control::setAnimations(const std::vector< Tuple<String,String> >& eventAttr)
    {
      CXBMCTinyXML xmlDoc;
      TiXmlElement xmlRootElement("control");
      TiXmlNode *pRoot = xmlDoc.InsertEndChild(xmlRootElement);
      if (!pRoot)
        throw WindowException("TiXmlNode creation error");

      std::vector<CAnimation> animations;

      for (unsigned int anim = 0; anim < eventAttr.size(); anim++)
      {
        const Tuple<String,String>& pTuple = eventAttr[anim];

        if (pTuple.GetNumValuesSet() != 2)
          throw WindowException("Error unpacking tuple found in list");

        const String& cEvent = pTuple.first();
        const String& cAttr = pTuple.second();

        TiXmlElement pNode("animation");
        std::vector<std::string> attrs = StringUtils::Split(cAttr, " ");
        for (std::vector<std::string>::const_iterator i = attrs.begin(); i != attrs.end(); ++i)
        {
          std::vector<std::string> attrs2 = StringUtils::Split(*i, "=");
          if (attrs2.size() == 2)
            pNode.SetAttribute(attrs2[0], attrs2[1]);
        }
        TiXmlText value(cEvent.c_str());
        pNode.InsertEndChild(value);
        pRoot->InsertEndChild(pNode);
      }

      const CRect animRect((float)dwPosX, (float)dwPosY, (float)dwPosX + dwWidth, (float)dwPosY + dwHeight);
      LOCKGUI;
      if (pGUIControl)
      {
        CGUIControlFactory::GetAnimations(pRoot, animRect, iParentId, animations);
        pGUIControl->SetAnimations(animations);
      }
    }
Ejemplo n.º 4
0
//-------------------------------------------------------------------------
// Function Name    :GetRoot
// Parameter(s)     :
// Return           :
// Memo             :获取根节点
//-------------------------------------------------------------------------
CXmlNodePtr CXml::GetRoot(void)
{	
	ASSERT( m_pDoc != NULL );

	MSXML2::IXMLDOMElementPtr pElement = NULL;
	HRESULT hr = m_pDoc->get_documentElement(&pElement);
	ASSERT( SUCCEEDED(hr) );

	// 不存在 则 创建
	if( pElement == NULL )
	{
		pElement = m_pDoc->createElement( _bstr_t(_T("xmlRoot")) );
		ASSERT( pElement != NULL );

		m_pDoc->appendChild(pElement);
	}

	CXmlNodePtr pNode( new CXmlNode(pElement) );

	SAFE_RELEASE(pElement);
	
	return pNode;
}
Ejemplo n.º 5
0
	//-------------------------------------------------------------------------
	// Function Name    :GetRoot
	// Parameter(s)     :
	// Return           :
	// Memo             :get the root element
	//-------------------------------------------------------------------------
	CXmlNodePtr CXml::GetRoot(void)
	{	
		ASSERT( m_pDoc != NULL );

		CXmlNodePtr pNode( new CXmlNode() );

		try
		{
			MSXML2::IXMLDOMElementPtr pElement = NULL;
			HRESULT hr = m_pDoc->get_documentElement(&pElement);
			ASSERT( SUCCEEDED(hr) );
			ASSERT( pElement != NULL );

			pNode->m_pNode = pElement;
			RELEASE_PTR(pElement);
		}
		catch ( _com_error e )
		{
			TRACE( _T("CXml::GetRoot failed:%s\n"), e.ErrorMessage());
			ASSERT( FALSE );
		}
		
		return pNode;
	}
Ejemplo n.º 6
0
std::auto_ptr<AifParseTreeNode> AifParseTreeNodeFactory::CreateNode( IAAFObjectSP sp )
{
	std::auto_ptr<AifParseTreeNode> pNode( new AifParseTreeNode(sp) );
	return pNode;
}
Ejemplo n.º 7
0
void MemoryMapBuilderCS::run()
{
    _interrupted = false;
    // Holds the data that is shared among all threads
    BuilderSharedState* shared = _map->_shared;

    MemoryMapNode* node = 0;

    // Now work through the whole stack
    QMutexLocker queueLock(&shared->queueLock);
    while ( !_interrupted && !shared->queue.isEmpty() &&
//            shared->processed < 1000 &&
            (!shared->lastNode ||
             shared->lastNode->probability() >= shared->minProbability) )
    {
        // Take element with highest probability
        node = shared->queue.takeLargest();
        shared->lastNode = node;
        ++shared->processed;
        queueLock.unlock();

        // try to save the physical mapping
        try {
            int pageSize;
            quint64 physAddr = _map->_vmem->virtualToPhysical(node->address(), &pageSize);
            // Linear memory region or paged memory?
            if (pageSize < 0) {
                PhysMemoryMapNode pNode(
                            physAddr,
                            node->size() > 0 ? physAddr + node->size() - 1 : physAddr,
                            node);
                shared->pmemMapLock.lockForWrite();
                _map->_pmemMap.insert(pNode);
                shared->pmemMapLock.unlock();
            }
            else {
                // Add all pages a type belongs to
                quint32 size = node->size();
                quint64 virtAddr = node->address();
                quint64 pageMask = ~(pageSize - 1);

                while (size > 0) {
                    physAddr = _map->_vmem->virtualToPhysical(virtAddr, &pageSize);
                    // How much space is left on current page?
                    quint32 sizeOnPage = pageSize - (virtAddr & ~pageMask);
                    if (sizeOnPage > size)
                        sizeOnPage = size;
                    PhysMemoryMapNode pNode(
                                physAddr, physAddr + sizeOnPage - 1, node);

                    // Add a memory mapping
                    shared->pmemMapLock.lockForWrite();
                    _map->_pmemMap.insert(pNode);
                    shared->pmemMapLock.unlock();
                    // Subtract the available space from left-over size
                    size -= sizeOnPage;
                    // Advance address
                    virtAddr += sizeOnPage;
                }
            }
        }
        catch (VirtualMemoryException&) {
            // Lock the mutex again before we jump to the loop condition checking
            queueLock.relock();
            // Don't proceed any further in case of an exception
            continue;
        }

        processNode(node);

        // Lock the mutex again before we jump to the loop condition checking
        queueLock.relock();
    }
}
Ejemplo n.º 8
0
void SearchQueryParser::parseTokens(QStringList tokens,
                                    QStringList searchColumns,
                                    AndNode* pQuery) const {
    while (tokens.size() > 0) {
        QString token = tokens.takeFirst().trimmed();
        if (token.length() == 0) {
            continue;
        }

        if (m_fuzzyMatcher.indexIn(token) != -1) {
            // TODO(XXX): implement this feature.
        } else if (m_textFilterMatcher.indexIn(token) != -1) {
            bool negate = token.startsWith(kNegatePrefix);
            QString field = m_textFilterMatcher.cap(1);
            QString argument = getTextArgument(
                m_textFilterMatcher.cap(2), &tokens).trimmed();

            if (!argument.isEmpty()) {
                std::unique_ptr<QueryNode> pNode(std::make_unique<TextFilterNode>(
                    m_database, m_fieldToSqlColumns[field], argument));
                if (negate) {
                    pNode = std::make_unique<NotNode>(std::move(pNode));
                }
                pQuery->addNode(std::move(pNode));
            }
        } else if (m_numericFilterMatcher.indexIn(token) != -1) {
            bool negate = token.startsWith(kNegatePrefix);
            QString field = m_numericFilterMatcher.cap(1);
            QString argument = getTextArgument(
                m_numericFilterMatcher.cap(2), &tokens).trimmed();

            if (!argument.isEmpty()) {
                std::unique_ptr<QueryNode> pNode(
                        std::make_unique<NumericFilterNode>(
                                m_fieldToSqlColumns[field], argument));
                if (negate) {
                    pNode = std::make_unique<NotNode>(std::move(pNode));
                }
                pQuery->addNode(std::move(pNode));
            }
        } else if (m_specialFilterMatcher.indexIn(token) != -1) {
            bool negate = token.startsWith(kNegatePrefix);
            bool fuzzy = token.startsWith(kFuzzyPrefix);
            QString field = m_specialFilterMatcher.cap(1);
            QString argument = getTextArgument(
                m_specialFilterMatcher.cap(2), &tokens).trimmed();
            std::unique_ptr<QueryNode> pNode;
            if (!argument.isEmpty()) {
                if (field == "key") {
                    mixxx::track::io::key::ChromaticKey key =
                            KeyUtils::guessKeyFromText(argument);
                    if (key == mixxx::track::io::key::INVALID) {
                        pNode = std::make_unique<TextFilterNode>(
                                m_database, m_fieldToSqlColumns[field], argument);
                    } else {
                        pNode = std::make_unique<KeyFilterNode>(key, fuzzy);
                    }
                } else if (field == "duration") {
                    pNode = std::make_unique<DurationFilterNode>(
                            m_fieldToSqlColumns[field], argument);
                } else if (field == "date_added" || field == "datetime_added" || field == "added" || field == "dateadded") {
		    field = "datetime_added";
		    pNode = std::make_unique<TextFilterNode>(
			m_database, m_fieldToSqlColumns[field], argument);
		}
            }
            if (pNode) {
                if (negate) {
                    pNode = std::make_unique<NotNode>(std::move(pNode));
                }
                pQuery->addNode(std::move(pNode));
            }
        } else {
            // If no advanced search feature matched, treat it as a search term.
            bool negate = token.startsWith(kNegatePrefix);
            if (negate) {
                token = token.mid(1);
            }

            // Don't trigger on a lone minus sign.
            if (!token.isEmpty()) {
                std::unique_ptr<QueryNode> pNode(
                        std::make_unique<TextFilterNode>(
                                m_database, searchColumns, token));
                if (negate) {
                    pNode = std::make_unique<NotNode>(std::move(pNode));
                }
                pQuery->addNode(std::move(pNode));
            }
        }
    }
}
Ejemplo n.º 9
0
// NOTE: This function can return NULL if the actor should not be displayed.
// Callers should be aware of this and handle it appropriately.
Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor )
{
	RString sPath( sPath_ );

	FileType ft = GetFileType( sPath );
	switch( ft )
	{
	case FT_Lua:
		{
			auto_ptr<XNode> pNode( LoadXNodeFromLuaShowErrors(sPath) );
			if( pNode.get() == NULL )
			{
				// XNode will warn about the error
				return new Actor;
			}

			Actor *pRet = ActorUtil::LoadFromNode( pNode.get(), pParentActor );
			return pRet;
		}
	case FT_Xml:
		{
			// Legacy actors; only supported in quirks mode
			if ( !PREFSMAN->m_bQuirksMode )
				return new Actor;

			XNode xml;
			if ( !XmlFileUtil::LoadFromFileShowErrors(xml, sPath) )
				return new Actor;
			XmlFileUtil::CompileXNodeTree( &xml, sPath );
			XmlFileUtil::AnnotateXNodeTree( &xml, sPath );
			return LoadFromNode( &xml, pParentActor );
		}
	case FT_Directory:
		{
			if( sPath.Right(1) != "/" )
				sPath += '/';

			RString sXml = sPath + "default.xml";
			if (DoesFileExist(sXml))
				return MakeActor(sXml, pParentActor);

			XNode xml;
			xml.AppendAttr( "Class", "BGAnimation" );
			xml.AppendAttr( "AniDir", sPath );

			return ActorUtil::LoadFromNode( &xml, pParentActor );
		}
	case FT_Bitmap:
	case FT_Movie:
		{
			XNode xml;
			xml.AppendAttr( "Class", "Sprite" );
			xml.AppendAttr( "Texture", sPath );

			return ActorUtil::LoadFromNode( &xml, pParentActor );
		}
	case FT_Sprite:
		{
			// Legacy actor; only supported in quirks mode
			if( !PREFSMAN->m_bQuirksMode )
				return new Actor;

			IniFile ini;
			ini.ReadFile( sPath );
			XmlFileUtil::AnnotateXNodeTree( &ini, sPath );

			return ActorUtil::LoadFromNode( ini.GetChild("Sprite"), pParentActor );
		}
	case FT_Model:
		{
			XNode xml;
			xml.AppendAttr( "Class", "Model" );
			xml.AppendAttr( "Meshes", sPath );
			xml.AppendAttr( "Materials", sPath );
			xml.AppendAttr( "Bones", sPath );

			return ActorUtil::LoadFromNode( &xml, pParentActor );
		}
	default:
		{
			LOG->Warn( "File \"%s\" has unknown type, \"%s\".", sPath.c_str(), FileTypeToString(ft).c_str() );

			XNode xml;
			xml.AppendAttr( "Class", "Actor" );
			return ActorUtil::LoadFromNode( &xml, pParentActor );
		}
	}
}
Ejemplo n.º 10
0
shared_ptr<NodeContent> NodeContent::makeAndNode(int arity){
  NodeContent *newNode = new NodeContent(InnerNodeType::AND, arity);
  shared_ptr<NodeContent> pNode(newNode);
  return pNode;
}
Ejemplo n.º 11
0
  PyObject* Control_SetAnimations(Control* self, PyObject* args)
  {
    PyObject *pList = NULL;
    if (!PyArg_ParseTuple(args, (char*)"O", &pList) || pList == NULL || !PyObject_TypeCheck(pList, &PyList_Type))
    {
      PyErr_SetString(PyExc_TypeError, "Object should be of type List");
      return NULL;
    }

    TiXmlDocument xmlDoc;
    TiXmlElement xmlRootElement("control");
    TiXmlNode *pRoot = xmlDoc.InsertEndChild(xmlRootElement);
    if (!pRoot)
    {
      PyErr_SetString(PyExc_TypeError, "TiXmlNode creation error");
      return NULL;
    }
    vector<CAnimation> animations;
    for (int anim = 0; anim < PyList_Size(pList); anim++)
    {
      PyObject *pTuple = NULL;
      char *cEvent = NULL;
      char *cAttr = NULL;
      pTuple = PyList_GetItem(pList, anim);
      if (pTuple == NULL || !PyObject_TypeCheck(pTuple, &PyTuple_Type))
      {
        PyErr_SetString(PyExc_TypeError, "List must only contain tuples");
        return NULL;
      }
      if (!PyArg_ParseTuple(pTuple, (char*)"ss", &cEvent, &cAttr))
      {
        PyErr_SetString(PyExc_TypeError, "Error unpacking tuple found in list");
        return NULL;
      }

      if (NULL != cAttr && NULL != cEvent)
      {
        TiXmlElement pNode("animation");
        CStdStringArray attrs;
        StringUtils::SplitString(cAttr, " ", attrs);
        for (unsigned int i = 0; i < attrs.size(); i++)
        {
          CStdStringArray attrs2;
          StringUtils::SplitString(attrs[i], "=", attrs2);
          if (attrs2.size() == 2)
            pNode.SetAttribute(attrs2[0], attrs2[1]);
        }
        TiXmlText value(cEvent);
        pNode.InsertEndChild(value);
        pRoot->InsertEndChild(pNode);
      }
    }

    //bool ret = xmlDoc.SaveFile("special://profile/test.txt");

    const CRect animRect((float)self->dwPosX, (float)self->dwPosY, (float)self->dwPosX + self->dwWidth, (float)self->dwPosY + self->dwHeight);
    PyXBMCGUILock();
    if (self->pGUIControl)
    {
      CGUIControlFactory::GetAnimations(pRoot, animRect, animations);
      self->pGUIControl->SetAnimations(animations);
    }
    PyXBMCGUIUnlock();

    Py_INCREF(Py_None);
    return Py_None;
  }
Ejemplo n.º 12
0
void Aif2XtlGroupVisitor::PreOrderVisit( Aif2XtlCompMobNode& node )
{
	node.SetVisitChildren( false );

	std::vector<AifParseTreeNode*> audioGroup;
	std::vector<AifParseTreeNode*> videoGroup;
	std::vector<AifParseTreeNode*> unknownGroup;

	int numChildren = node.GetNumChildren();
	int i;
	for ( i = 0; i < numChildren; ++i ) {
		// This is not a bug!
		// Each time a child is released, the rest of the children
		// are shuffled down one position in the underlying vector.
		// Hence if we release child zero numChildren times, we have
		// released all the children.
		std::auto_ptr<AifParseTreeNode> pChildNode = node.ReleaseChild(0);


		if ( dynamic_cast<Aif2XtlTimelineMobSlot*>(pChildNode.get()) ){
			
			Aif2XtlTimelineMobSlot* pTimelineNode =
				dynamic_cast<Aif2XtlTimelineMobSlot*>(pChildNode.release());		

			AxTimelineMobSlot axTimelineMobSlot( pTimelineNode->GetAif2XtlAAFObject() );

			AxSegment axSeg( axTimelineMobSlot.GetSegment() );
			
			AxDataDef axDataDef( axSeg.GetDataDef() );

			if ( axDataDef.IsSoundKind() ) {
				audioGroup.push_back( pTimelineNode );
			}
			else if ( axDataDef.IsPictureKind() ) {
				videoGroup.push_back( pTimelineNode );
				}
			else {
				unknownGroup.push_back( pTimelineNode );
			}
			
		}
		else {
			unknownGroup.push_back( pChildNode.release() );
		}
	}

	// FIXME - The should probably be deleted.  They may cause
	// erroneous XTL to be generated.
	// Put the unknown nodes back in the order they were removed.
	std::vector<AifParseTreeNode*>::iterator iter;
	for ( iter = unknownGroup.begin();
		  iter != unknownGroup.end();
		  ++iter ) {
			  std::auto_ptr<AifParseTreeNode> pNode( *iter );
			  node.AddChild( pNode );
	}
		  
	// Create an audio group node and reparent the audio nodes
	if ( audioGroup.size() > 0 ) {
		std::auto_ptr<AifParseTreeNode> pAudioGroupNode( new Aif2XtlGroupNode );
		for ( iter = audioGroup.begin();
			  iter != audioGroup.end();
			++iter ) {
				  std::auto_ptr<AifParseTreeNode> pNode( *iter );
				pAudioGroupNode->AddChild( pNode );
		}
		std::auto_ptr<Aif2XtlGroupInfo> pAudioGroupInfo(	
					new Aif2XtlGroupInfo(Aif2XtlGroupInfo::GROUP_TYPE_AUDIO) );
		pAudioGroupNode->PushDecoration( pAudioGroupInfo );
		node.AddChild( pAudioGroupNode );
	}

	// Create a video group node and reparent the video nodes
	if ( videoGroup.size() > 0 ) {
		std::auto_ptr<AifParseTreeNode> pVideoGroupNode( new Aif2XtlGroupNode );
		for ( iter = videoGroup.begin();
			  iter != videoGroup.end();
			++iter ) {
				  std::auto_ptr<AifParseTreeNode> pNode( *iter );
				pVideoGroupNode->AddChild( pNode );
		}
		std::auto_ptr<Aif2XtlGroupInfo> pVideoGroupInfo(
			new Aif2XtlGroupInfo(Aif2XtlGroupInfo::GROUP_TYPE_VIDEO) );
		pVideoGroupNode->PushDecoration( pVideoGroupInfo );
		node.AddChild( pVideoGroupNode );
	}
}
Ejemplo n.º 13
0
int main( int argc, char** argv )
{
    //assert( false );

    //ds pwd info
    std::fflush( stdout);
    std::printf( "(main) launched: %s\n", argv[0] );
    CLogger::openBox( );

    //ds OpenMP
    const uint8_t uOpenMPNumberOfThreads( 2 );
    omp_set_num_threads( uOpenMPNumberOfThreads );
    uint8_t uOpenMPThreadsActive( 0 );

    //ds measure active threads
    #pragma omp parallel shared( uOpenMPThreadsActive )
    {
        ++uOpenMPThreadsActive;
    }

    std::printf( "(main) OpenMP set threads: %i | cur threads: %u | max threads: %i\n", uOpenMPNumberOfThreads, uOpenMPThreadsActive, omp_get_max_threads( ) );

    //ds cutoff distance
    double dMatchingDistanceCutoffTriangulation( 300.0 );

    if( 2 == argc )
    {
        dMatchingDistanceCutoffTriangulation = std::atof( argv[1] );
    }

    //ds configuration parameters
    std::string strTopicCameraRIGHT( "/thin_visensor_node/camera_right/image_raw" );
    std::string strTopicCameraLEFT ( "/thin_visensor_node/camera_left/image_raw" );
    std::string strTopicIMU        ( "/thin_visensor/imu_adis16448" );
    uint32_t uMaximumQueueSizeCamera( 10 );
    //uint32_t uMaximumQueueSizeIMU   ( 100 );

    //ds setup node
    ros::init( argc, argv, "test_depth" );
    std::shared_ptr< ros::NodeHandle > pNode( new ros::NodeHandle( "~" ) );

    //ds escape here on failure
    if( !pNode->ok( ) )
    {
        std::printf( "\n(main) ERROR: unable to instantiate node\n" );
        std::printf( "(main) terminated: %s\n", argv[0]);
        std::fflush( stdout );
        return 1;
    }

    //ds log configuration
    std::printf( "(main) ROS node namespace     := '%s'\n", pNode->getNamespace( ).c_str( ) );
    std::printf( "(main) ROS topic camera LEFT  := '%s'\n", strTopicCameraRIGHT.c_str( ) );
    std::printf( "(main) ROS topic camera RIGHT := '%s'\n", strTopicCameraLEFT.c_str( ) );
    std::printf( "(main) ROS topic IMU          := '%s'\n", strTopicIMU.c_str( ) );
    std::printf( "(main) matching distance cut  := '%f'\n", dMatchingDistanceCutoffTriangulation );
    std::fflush( stdout );
    CLogger::closeBox( );

    g_pTriangulator = std::make_shared< CTriangulator >( g_pCameraSTEREO, g_pExtractor, g_pMatcher, dMatchingDistanceCutoffTriangulation );

    //ds subscribe to topics
    ros::Subscriber cSubscriberCameraRIGHT = pNode->subscribe( strTopicCameraRIGHT, uMaximumQueueSizeCamera, callbackCameraRIGHT );
    ros::Subscriber cSubscriberCameraLEFT  = pNode->subscribe( strTopicCameraLEFT , uMaximumQueueSizeCamera, callbackCameraLEFT );
    //ros::Subscriber cSubscribeIMU0         = pNode->subscribe( strTopicIMU        , uMaximumQueueSizeIMU   , callbackIMU0 );

    //ds start callback pump
    ros::spin( );

    //ds exit
    std::printf( "\n(main) terminated: %s\n", argv[0] );
    std::fflush( stdout);
    return 0;
}
Ejemplo n.º 14
0
		node& memory::create_node()
		{
			shared_node pNode(new node);
			m_nodes.insert(pNode);
			return *pNode;
		}
Ejemplo n.º 15
0
shared_ptr<NodeContent> NodeContent::makeLeafNode(int leafValue) {
  NodeContent *newNode = new NodeContent(leafValue);
  shared_ptr<NodeContent> pNode(newNode);
  return pNode;
}
Ejemplo n.º 16
0
		node& memory::create_node(const Mark& mark)
		{
			shared_node pNode(new node(mark));
			m_nodes.insert(pNode);
			return *pNode;
		}
Ejemplo n.º 17
0
shared_ptr<NodeContent> NodeContent::makeNILNode(){
  NodeContent *newNode = new NodeContent();
  shared_ptr<NodeContent> pNode(newNode);
  return pNode;
}