Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
1dc2efd9
Commit
1dc2efd9
authored
Sep 16, 2009
by
Alexander Wiebel
Browse files
[ADD
#103
] added operator[] for WSubject and WDataHadnler.
parent
e29be52e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
src/dataHandler/WDataHandler.cpp
src/dataHandler/WDataHandler.cpp
+4
-0
src/dataHandler/WDataHandler.h
src/dataHandler/WDataHandler.h
+6
-0
src/dataHandler/WSubject.cpp
src/dataHandler/WSubject.cpp
+5
-0
src/dataHandler/WSubject.h
src/dataHandler/WSubject.h
+7
-1
No files found.
src/dataHandler/WDataHandler.cpp
View file @
1dc2efd9
...
...
@@ -41,6 +41,10 @@ boost::shared_ptr< const WSubject > WDataHandler::getSubject( const unsigned int
return
m_subjects
.
at
(
subjectId
);
}
boost
::
shared_ptr
<
const
WSubject
>
WDataHandler
::
operator
[](
size_t
subjectId
)
const
{
return
getSubject
(
subjectId
);
}
void
WDataHandler
::
addSubject
(
boost
::
shared_ptr
<
WSubject
>
newSubject
)
{
...
...
src/dataHandler/WDataHandler.h
View file @
1dc2efd9
...
...
@@ -57,6 +57,12 @@ public:
*/
boost
::
shared_ptr
<
const
WSubject
>
getSubject
(
const
unsigned
int
subjectId
)
const
;
/**
* Returns a to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost
::
shared_ptr
<
const
WSubject
>
operator
[](
size_t
subjectId
)
const
;
/**
* Insert a new WSubject referenced by a pointer.
*/
...
...
src/dataHandler/WSubject.cpp
View file @
1dc2efd9
...
...
@@ -36,6 +36,11 @@ boost::shared_ptr< const WDataSet > WSubject::getDataSet( const unsigned int dat
return
m_dataSets
.
at
(
dataSetId
);
}
boost
::
shared_ptr
<
const
WDataSet
>
WSubject
::
operator
[](
const
unsigned
int
dataSetId
)
const
{
return
getDataSet
(
dataSetId
);
}
void
WSubject
::
addDataSet
(
boost
::
shared_ptr
<
WDataSet
>
newDataSet
)
{
...
...
src/dataHandler/WSubject.h
View file @
1dc2efd9
...
...
@@ -46,7 +46,13 @@ public:
* Get the pointer to the i'th WDataSet. The return type is const since we
* want to ensure that each DataSet cannot modified after retrival.
*/
boost
::
shared_ptr
<
const
WDataSet
>
getDataSet
(
const
unsigned
int
subjectId
)
const
;
boost
::
shared_ptr
<
const
WDataSet
>
getDataSet
(
const
unsigned
int
dataSetId
)
const
;
/**
* Returns a to the i'th WSubject. The return type is const since we
* want to ensure that each subject cannot modified after retrival.
*/
boost
::
shared_ptr
<
const
WDataSet
>
operator
[](
const
unsigned
int
dataSetId
)
const
;
/**
* Insert a new DataSet referenced by a pointer.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment