COPASI API  4.16.103
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CRDFSubject Class Reference

#include <CRDFSubject.h>

Collaboration diagram for CRDFSubject:
Collaboration graph
[legend]

Public Types

enum  eSubjectType { RESOURCE = 0, BLANK_NODE }
 

Public Member Functions

void clearData ()
 
 CRDFSubject ()
 
 CRDFSubject (const CRDFSubject &src)
 
const std::string & getBlankNodeID () const
 
const std::string & getResource () const
 
const eSubjectTypegetType () const
 
const bool & isLocal () const
 
CRDFSubjectoperator= (const CRDFSubject &rhs)
 
void setBlankNodeId (const std::string &blankNodeId)
 
void setResource (const std::string &resource, const bool &isLocal)
 
void setType (const eSubjectType &type)
 
 ~CRDFSubject ()
 

Private Member Functions

bool operator== (const CRDFSubject &rhs) const
 

Private Attributes

std::string mBlankNodeId
 
bool mIsLocalResource
 
std::string mResource
 
eSubjectType mType
 

Detailed Description

Definition at line 23 of file CRDFSubject.h.

Member Enumeration Documentation

The two different types possible for subjects

Enumerator
RESOURCE 
BLANK_NODE 

Definition at line 30 of file CRDFSubject.h.

Constructor & Destructor Documentation

CRDFSubject::CRDFSubject ( )

Default Constructor

Definition at line 22 of file CRDFSubject.cpp.

22  :
23  mType(RESOURCE),
24  mResource(""),
25  mIsLocalResource(false),
26  mBlankNodeId("")
27 {}
std::string mBlankNodeId
Definition: CRDFSubject.h:124
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
CRDFSubject::CRDFSubject ( const CRDFSubject src)

Copy Constructor

Parameters
constCRDFSubject & src

Definition at line 29 of file CRDFSubject.cpp.

29  :
30  mType(src.mType),
31  mResource(src.mResource),
34 {}
std::string mBlankNodeId
Definition: CRDFSubject.h:124
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
CRDFSubject::~CRDFSubject ( )

Destructor

Definition at line 36 of file CRDFSubject.cpp.

37 {}

Member Function Documentation

void CRDFSubject::clearData ( )

Reset all Data

Definition at line 94 of file CRDFSubject.cpp.

References mBlankNodeId, mIsLocalResource, mResource, mType, and RESOURCE.

95 {
96  mBlankNodeId = "";
97  mResource = "";
99  mIsLocalResource = false;
100 }
std::string mBlankNodeId
Definition: CRDFSubject.h:124
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
const std::string & CRDFSubject::getBlankNodeID ( ) const

Retrieve the ID of the blank node of the subject

Returns
const std::string & blankNodeId

Definition at line 91 of file CRDFSubject.cpp.

References mBlankNodeId.

Referenced by CRDFGraph::addTriplet(), CQRDFTreeView::enterProtected(), operator<<(), CRDFNode::setSubject(), and CRDFWriter::write().

92  {return mBlankNodeId;}
std::string mBlankNodeId
Definition: CRDFSubject.h:124
const std::string & CRDFSubject::getResource ( ) const

Retrieve the resource of the subject

Returns
const std::string & resource

Definition at line 82 of file CRDFSubject.cpp.

References mResource.

Referenced by CRDFGraph::addTriplet(), CQRDFTreeView::enterProtected(), CRDFGraph::guessGraphRoot(), operator<<(), and CRDFWriter::write().

83  {return mResource;}
std::string mResource
Definition: CRDFSubject.h:114
const CRDFSubject::eSubjectType & CRDFSubject::getType ( ) const

Retrieve the type of the subject

Returns
const eSubjectType & type

Definition at line 73 of file CRDFSubject.cpp.

References mType.

Referenced by CRDFGraph::addTriplet(), CQRDFTreeView::enterProtected(), CRDFGraph::guessGraphRoot(), operator<<(), CRDFNode::setSubject(), and CRDFWriter::write().

74  {return mType;}
eSubjectType mType
Definition: CRDFSubject.h:109
const bool & CRDFSubject::isLocal ( ) const

Check whehter the resource is local

Returns
const bool & isLocal

Definition at line 85 of file CRDFSubject.cpp.

References mIsLocalResource.

Referenced by CRDFGraph::addTriplet(), CRDFGraph::guessGraphRoot(), and setResource().

86  {return mIsLocalResource;}
bool mIsLocalResource
Definition: CRDFSubject.h:119
CRDFSubject & CRDFSubject::operator= ( const CRDFSubject rhs)

Definition at line 39 of file CRDFSubject.cpp.

References mBlankNodeId, mIsLocalResource, mResource, and mType.

40 {
41  if (this != &rhs)
42  {
43  mType = rhs.mType;
44  mResource = rhs.mResource;
47  }
48  return *this;
49 }
std::string mBlankNodeId
Definition: CRDFSubject.h:124
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
bool CRDFSubject::operator== ( const CRDFSubject rhs) const
private

Definition at line 51 of file CRDFSubject.cpp.

References BLANK_NODE, mBlankNodeId, mIsLocalResource, mResource, mType, and RESOURCE.

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  }
std::string mBlankNodeId
Definition: CRDFSubject.h:124
eSubjectType mType
Definition: CRDFSubject.h:109
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
void CRDFSubject::setBlankNodeId ( const std::string &  blankNodeId)

Set the ID of the blank node of the subject

Parameters
conststd::string & blankNodeId

Definition at line 88 of file CRDFSubject.cpp.

References mBlankNodeId.

Referenced by CRDFNode::setObject(), and CRDFParser::TripleHandler().

89 {mBlankNodeId = blankNodeId;}
std::string mBlankNodeId
Definition: CRDFSubject.h:124
void CRDFSubject::setResource ( const std::string &  resource,
const bool &  isLocal 
)

Set the resource of the subject

Parameters
conststd::string & resource
constbool & isLocal

Definition at line 76 of file CRDFSubject.cpp.

References isLocal(), mIsLocalResource, and mResource.

Referenced by CRDFGraph::createAboutNode(), and CRDFParser::TripleHandler().

77 {
78  mResource = resource;
80 }
bool mIsLocalResource
Definition: CRDFSubject.h:119
std::string mResource
Definition: CRDFSubject.h:114
const bool & isLocal() const
Definition: CRDFSubject.cpp:85
void CRDFSubject::setType ( const eSubjectType type)

Set the type of the subject

Parameters
consteSubjectType & type

Definition at line 70 of file CRDFSubject.cpp.

References mType.

Referenced by CRDFGraph::createAboutNode(), CRDFNode::setObject(), and CRDFParser::TripleHandler().

71 {mType = type;}
eSubjectType mType
Definition: CRDFSubject.h:109

Member Data Documentation

std::string CRDFSubject::mBlankNodeId
private

The Id of the blank node for type BLANK_NODE

Definition at line 124 of file CRDFSubject.h.

Referenced by clearData(), getBlankNodeID(), operator=(), operator==(), and setBlankNodeId().

bool CRDFSubject::mIsLocalResource
private

Stores whether the reources is resolve locally or remotely.

Definition at line 119 of file CRDFSubject.h.

Referenced by clearData(), isLocal(), operator=(), operator==(), and setResource().

std::string CRDFSubject::mResource
private

The URI of the resource of type RESOURCE

Definition at line 114 of file CRDFSubject.h.

Referenced by clearData(), getResource(), operator=(), operator==(), and setResource().

eSubjectType CRDFSubject::mType
private

The type of the subject

Definition at line 109 of file CRDFSubject.h.

Referenced by clearData(), getType(), operator=(), operator==(), and setType().


The documentation for this class was generated from the following files: