| 1 | /******************************************************************************* |
|---|
| 2 | |
|---|
| 3 | Copyright 2004, 2007 Virginia Polytechnic Institute and State University |
|---|
| 4 | |
|---|
| 5 | This file is part of the OSSIE Parser. |
|---|
| 6 | |
|---|
| 7 | OSSIE Parser is free software; you can redistribute it and/or modify |
|---|
| 8 | it under the terms of the Lesser GNU General Public License as published by |
|---|
| 9 | the Free Software Foundation; either version 2.1 of the License, or |
|---|
| 10 | (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | OSSIE Parser is distributed in the hope that it will be useful, |
|---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | Lesser GNU General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the Lesser GNU General Public License |
|---|
| 18 | along with OSSIE Parser; if not, write to the Free Software |
|---|
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | |
|---|
| 21 | Even though all code is original, the architecture of the OSSIE Parser is based |
|---|
| 22 | on the architecture of the CRCs SCA Reference Implementation (SCARI) |
|---|
| 23 | see: http://www.crc.ca/en/html/rmsc/home/sdr/projects/scari |
|---|
| 24 | |
|---|
| 25 | *********************************************************************************/ |
|---|
| 26 | |
|---|
| 27 | #include "ossie/UsesPort.h" |
|---|
| 28 | #include "ossie/debug.h" |
|---|
| 29 | |
|---|
| 30 | UsesPort::UsesPort(TiXmlElement *root) : Port(root) |
|---|
| 31 | { |
|---|
| 32 | DEBUG(9, UsesPort, "In constructor."); |
|---|
| 33 | |
|---|
| 34 | Port::parsePort(root); // call the base class first |
|---|
| 35 | parseID(root); |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | // copy constructor |
|---|
| 40 | UsesPort::UsesPort(const UsesPort & _up): |
|---|
| 41 | identifier(NULL) |
|---|
| 42 | { |
|---|
| 43 | |
|---|
| 44 | this->ifComponentInstantiationRef = _up.ifComponentInstantiationRef; |
|---|
| 45 | this->ifDeviceThatLoadedThisComponentRef = |
|---|
| 46 | _up.ifDeviceThatLoadedThisComponentRef; |
|---|
| 47 | this->ifDeviceUsedByThisComponentRef = _up.ifDeviceUsedByThisComponentRef; |
|---|
| 48 | this->ifFindBy = _up.ifFindBy; |
|---|
| 49 | |
|---|
| 50 | identifier = _up.identifier; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | UsesPort::~UsesPort() |
|---|
| 54 | { |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | void UsesPort::parseID(TiXmlElement *elem) |
|---|
| 59 | { |
|---|
| 60 | TiXmlElement *usesId = elem->FirstChildElement("usesidentifier"); |
|---|
| 61 | identifier = usesId->GetText(); |
|---|
| 62 | |
|---|
| 63 | DEBUG(9, UsesPort, "Found uses port " << identifier); |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | const char* UsesPort::getID() |
|---|
| 67 | { |
|---|
| 68 | return identifier.c_str(); |
|---|
| 69 | } |
|---|