Ejemplo n.º 1
0
UUIDVector OTSDPAttribute::getAllUUIDs() {

    UUIDVector uuids;

    if (getType() == UUID) {
      uuids.resize( uuids.size()+1 );
      uuids[uuids.size()-1] = getUUID();
    } else {
      AttributeVector * subAttributes = 0 ;

      if (getType() == SEQUENCE) {
          subAttributes = getSequence();
      } else if (getType() == ALTERNATIVE) {
          subAttributes = getAlternative();
      }

      if (!subAttributes)
          return 0;

      int os;
      for( unsigned int i = 0; i < subAttributes->count(); i++ ) {
        UUIDVector subUUIDs = (*subAttributes)[i]->getAllUUIDs();

        os = uuids.size();
        uuids.resize( uuids.size()+subUUIDs.count() );

        for( unsigned int k = 0; k < subUUIDs.count(); k++ ) {
          uuids[os + k] = subUUIDs[k];
        }
      }
    }
    return uuids;
}