COPASI API  4.16.103
CRDFSubject.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/MIRIAM/CRDFSubject.cpp,v $
3 // $Revision: 1.8 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2008/06/10 20:31:11 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #include "copasi.h"
19 
20 #include "CRDFSubject.h"
21 
23  mType(RESOURCE),
24  mResource(""),
25  mIsLocalResource(false),
26  mBlankNodeId("")
27 {}
28 
30  mType(src.mType),
31  mResource(src.mResource),
32  mIsLocalResource(src.mIsLocalResource),
33  mBlankNodeId(src.mBlankNodeId)
34 {}
35 
37 {}
38 
40 {
41  if (this != &rhs)
42  {
43  mType = rhs.mType;
44  mResource = rhs.mResource;
47  }
48  return *this;
49 }
50 
51 bool CRDFSubject::operator ==(const CRDFSubject& rhs) const
52  {
53  if (mType == rhs.mType)
54  {
55  switch (mType)
56  {
58  if (mBlankNodeId == rhs.mBlankNodeId)
59  {return true;}
60  break;
63  {return true;}
64  break;
65  }
66  }
67  return false;
68  }
69 
71 {mType = type;}
72 
74  {return mType;}
75 
76 void CRDFSubject::setResource(const std::string & resource, const bool & isLocal)
77 {
78  mResource = resource;
80 }
81 
82 const std::string & CRDFSubject::getResource() const
83  {return mResource;}
84 
85 const bool & CRDFSubject::isLocal() const
86  {return mIsLocalResource;}
87 
88 void CRDFSubject::setBlankNodeId(const std::string & blankNodeId)
89 {mBlankNodeId = blankNodeId;}
90 
91 const std::string & CRDFSubject::getBlankNodeID() const
92  {return mBlankNodeId;}
93 
95 {
96  mBlankNodeId = "";
97  mResource = "";
99  mIsLocalResource = false;
100 }
101 
102 std::ostream & operator << (std::ostream & os, const CRDFSubject & subject)
103 {
104  switch (subject.getType())
105  {
107  os << subject.getBlankNodeID();
108  break;
110  os << subject.getResource();
111  break;
112  }
113 
114  return os;
115 }
std::string mBlankNodeId
Definition: CRDFSubject.h:124
const std::string & getResource() const
Definition: CRDFSubject.cpp:82
const std::string & getBlankNodeID() const
Definition: CRDFSubject.cpp:91
std::ostream & operator<<(std::ostream &os, const CRDFSubject &subject)
bool operator==(const CRDFSubject &rhs) const
Definition: CRDFSubject.cpp:51
void setBlankNodeId(const std::string &blankNodeId)
Definition: CRDFSubject.cpp:88
void setResource(const std::string &resource, const bool &isLocal)
Definition: CRDFSubject.cpp:76
CRDFSubject & operator=(const CRDFSubject &rhs)
Definition: CRDFSubject.cpp:39
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
const bool & isLocal() const
Definition: CRDFSubject.cpp:85
void setType(const eSubjectType &type)
Definition: CRDFSubject.cpp:70
const eSubjectType & getType() const
Definition: CRDFSubject.cpp:73
void clearData()
Definition: CRDFSubject.cpp:94