Changeset 477 for branches


Ignore:
Timestamp:
03/20/14 14:20:02 (5 years ago)
Author:
jls17
Message:
  • added support to create references between other workflow objects and containers
Location:
branches/work_304
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/work_304/core/ARContainer.cpp

    r475 r477  
    165165        return CARInside::GetInstance()->containerList.ContainerGetContent(GetInsideId()); 
    166166} 
     167 
     168void CARContainer::AddReference(const CRefItem &refItem) 
     169{ 
     170        return CARInside::GetInstance()->containerList.AddReference(GetInsideId(), refItem); 
     171} 
     172 
     173const CARContainer::ReferenceList& CARContainer::GetReferences() const 
     174{ 
     175        return CARInside::GetInstance()->containerList.GetReferences(GetInsideId()); 
     176} 
  • branches/work_304/core/ARContainer.h

    r475 r477  
    6161        bool IsClonable() const; 
    6262        CARServerObject* Clone() const; 
     63 
     64        typedef vector<CRefItem> ReferenceList; 
     65        void AddReference(const CRefItem& refItem); 
     66        const ReferenceList& GetReferences() const; 
    6367private: 
    6468}; 
  • branches/work_304/lists/ARContainerList.cpp

    r476 r477  
    285285                        sortedList.push_back(i); 
    286286                } 
     287                references.resize(names.numItems); 
    287288        } 
    288289 
     
    338339        objProps.numItems = 0; 
    339340        objProps.propsList = new ARPropList[size]; 
     341 
     342        references.resize(size); 
    340343 
    341344        reservedSize = size; 
     
    447450        return overlayAndCustomList; 
    448451} 
     452 
     453void CARContainerList::AddReference(unsigned int index, const CRefItem &refItem) 
     454{ 
     455        if (!ReferenceExists(index, refItem)) 
     456                references[sortedList[index]].push_back(refItem); 
     457} 
     458 
     459bool CARContainerList::ReferenceExists(unsigned int index, const CRefItem &refItem) 
     460{ 
     461        ReferenceList::iterator curIt = references[sortedList[index]].begin(); 
     462        ReferenceList::iterator endIt = references[sortedList[index]].end(); 
     463 
     464        for (; curIt != endIt; ++curIt) 
     465        { 
     466                if (*curIt == refItem) 
     467                        return true; 
     468        } 
     469        return false; 
     470} 
     471 
     472const CARContainerList::ReferenceList& CARContainerList::GetReferences(unsigned int index) 
     473{ 
     474        return references[sortedList[index]]; 
     475} 
  • branches/work_304/lists/ARContainerList.h

    r476 r477  
    5858        void ContainerSetAppRefName(unsigned int index, const string& appName) { assert(index < appRefNames.size()); appRefNames[sortedList[index]] = appName; } 
    5959 
     60        // referencing 
     61        typedef vector<CRefItem> ReferenceList; 
     62        void AddReference(unsigned int index, const CRefItem& refItem); 
     63        bool ReferenceExists(unsigned int index, const CRefItem& refItem); 
     64        const ReferenceList& GetReferences(unsigned int index); 
     65 
    6066        void AddOverlayOrCustom(unsigned int index); 
    6167        const ObjectRefList& GetOverlayAndCustomWorkflow(); 
     
    8793        CMapType searchList; 
    8894        vector<int> overlayAndCustomList; 
     95        vector<ReferenceList> references; 
    8996}; 
Note: See TracChangeset for help on using the changeset viewer.