Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
4e387085
There was an error fetching the commit references. Please try again later.
Commit
4e387085
authored
6 years ago
by
Nina Džugasová
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation into Containers/List.
parent
52547963
No related branches found
No related tags found
1 merge request
!15
Nina
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/TNL/Containers/List.h
+38
-25
38 additions, 25 deletions
src/TNL/Containers/List.h
src/TNL/File.h
+2
-2
2 additions, 2 deletions
src/TNL/File.h
src/TNL/Logger.h
+4
-1
4 additions, 1 deletion
src/TNL/Logger.h
src/UnitTests/TimerTest.cpp
+6
-2
6 additions, 2 deletions
src/UnitTests/TimerTest.cpp
with
50 additions
and
30 deletions
src/TNL/Containers/List.h
+
38
−
25
View file @
4e387085
...
@@ -43,27 +43,34 @@ template< class T > class List
...
@@ -43,27 +43,34 @@ template< class T > class List
public:
public:
typedef
T
ValueType
;
typedef
T
ValueType
;
//! Basic constructor
/// \brief Basic constructor.
///
/// Constructs an empty list.
List
();
List
();
//! Copy constructor
/// \brief Copy constructor.
///
/// Construct a copy of \e list.
/// @param list Name of another list.
List
(
const
List
&
list
);
List
(
const
List
&
list
);
//! Destructor
/// \brief Destructor.
///
/// Destroys the list. References to the values in the list become invalid.
~
List
();
~
List
();
static
String
getType
();
static
String
getType
();
//
! If the list is empty return 'true'
//
/ Returns \e true if the list contains no items, otherwise returns \e false.
bool
isEmpty
()
const
;
bool
isEmpty
()
const
;
//
!
Return
size of
the list
//
/
Return
s number of items in
the list
.
int
getSize
()
const
;
int
getSize
()
const
;
//
!
Indexing operator
//
/
Indexing operator
.
T
&
operator
[]
(
const
int
&
ind
);
T
&
operator
[]
(
const
int
&
ind
);
//
!
Indexing operator for constant instances
//
/
Indexing operator for constant instances
.
const
T
&
operator
[]
(
const
int
&
ind
)
const
;
const
T
&
operator
[]
(
const
int
&
ind
)
const
;
const
List
&
operator
=
(
const
List
&
lst
);
const
List
&
operator
=
(
const
List
&
lst
);
...
@@ -72,64 +79,70 @@ template< class T > class List
...
@@ -72,64 +79,70 @@ template< class T > class List
bool
operator
!=
(
const
List
&
lst
)
const
;
bool
operator
!=
(
const
List
&
lst
)
const
;
//! Append new data element
/// \brief Appends new data element.
///
/// Inserts \e data at the end of the list.
bool
Append
(
const
T
&
data
);
bool
Append
(
const
T
&
data
);
//! Prepend new data element
/// \brief Prepends new data element.
///
/// Inserts \e data at the beginning of the list.
bool
Prepend
(
const
T
&
data
);
bool
Prepend
(
const
T
&
data
);
//! Insert new data element at given position
/// \brief Inserts new data element at given position.
///
/// Inserts \e data at index position \e ind in the list.
bool
Insert
(
const
T
&
data
,
const
int
&
ind
);
bool
Insert
(
const
T
&
data
,
const
int
&
ind
);
//
!
Append copy of another list
//
/
Append
s
copy of another list
.
bool
AppendList
(
const
List
<
T
>&
lst
);
bool
AppendList
(
const
List
<
T
>&
lst
);
//
!
Prepend copy of another list
//
/
Prepend
s
copy of another list
.
bool
PrependList
(
const
List
<
T
>&
lst
);
bool
PrependList
(
const
List
<
T
>&
lst
);
template
<
typename
Array
>
template
<
typename
Array
>
void
toArray
(
Array
&
array
);
void
toArray
(
Array
&
array
);
//
!
Erase data element at given position
//
/
Erase
s
data element at given position
.
void
Erase
(
const
int
&
ind
);
void
Erase
(
const
int
&
ind
);
//
!
Erase data element with contained data at given position
//
/
Erase
s
data element with contained data at given position
.
void
DeepErase
(
const
int
&
ind
);
void
DeepErase
(
const
int
&
ind
);
//
!
Erase all data elements
//
/
Erase
s
all data elements
.
void
reset
();
void
reset
();
//
!
Erase all data elements with contained data
//
/
Erase
s
all data elements with contained data
.
void
DeepEraseAll
();
void
DeepEraseAll
();
//
!
Save the list in binary format
//
/
Save
s
the list in binary format
.
bool
Save
(
File
&
file
)
const
;
bool
Save
(
File
&
file
)
const
;
//
!
Save the list in binary format using method save of type T
//
/
Save
s
the list in binary format using method save of type T
.
bool
DeepSave
(
File
&
file
)
const
;
bool
DeepSave
(
File
&
file
)
const
;
//
!
Load the list
//
/
Load
s
the list
.
bool
Load
(
File
&
file
);
bool
Load
(
File
&
file
);
//
!
Load the list using method Load of the type T
//
/
Load
s
the list using method Load of the type T
.
bool
DeepLoad
(
File
&
file
);
bool
DeepLoad
(
File
&
file
);
protected:
protected:
//
!
Pointer to the first element
//
/
Pointer to the first element
.
ListDataElement
<
T
>*
first
;
ListDataElement
<
T
>*
first
;
//
!
Pointer to the last element
//
/
Pointer to the last element
.
/*! We use pointer to last element while adding new element to keep order of elements
/*! We use pointer to last element while adding new element to keep order of elements
*/
*/
ListDataElement
<
T
>*
last
;
ListDataElement
<
T
>*
last
;
//
!
List size
//
/
List size
.
int
size
;
int
size
;
//
!
Iterator
//
/
Iterator
.
mutable
ListDataElement
<
T
>*
iterator
;
mutable
ListDataElement
<
T
>*
iterator
;
//
!
Iterator index
//
/
Iterator index
.
mutable
int
index
;
mutable
int
index
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/TNL/File.h
+
2
−
2
View file @
4e387085
...
@@ -76,13 +76,13 @@ class File
...
@@ -76,13 +76,13 @@ class File
return
this
->
fileName
;
return
this
->
fileName
;
}
}
/// Returns read elements.
/// Returns
number of
read elements.
long
int
getReadElements
()
const
long
int
getReadElements
()
const
{
{
return
this
->
readElements
;
return
this
->
readElements
;
}
}
/// Returns written elements.
/// Returns
number of
written elements.
long
int
getWrittenElements
()
const
long
int
getWrittenElements
()
const
{
{
return
this
->
writtenElements
;
return
this
->
writtenElements
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Logger.h
+
4
−
1
View file @
4e387085
...
@@ -19,6 +19,7 @@ class Logger
...
@@ -19,6 +19,7 @@ class Logger
{
{
public:
public:
/////
/// \brief Basic constructor.
/// \brief Basic constructor.
///
///
/// \param _width Integer that defines the width of logger.
/// \param _width Integer that defines the width of logger.
...
@@ -26,6 +27,7 @@ class Logger
...
@@ -26,6 +27,7 @@ class Logger
Logger
(
int
_width
,
Logger
(
int
_width
,
std
::
ostream
&
_stream
);
std
::
ostream
&
_stream
);
/////
/// \brief Creates header in given logger.
/// \brief Creates header in given logger.
///
///
/// \param title String desribing the title/header.
/// \param title String desribing the title/header.
...
@@ -34,11 +36,12 @@ class Logger
...
@@ -34,11 +36,12 @@ class Logger
/// \brief Creates predefined separator - structure in the logger.
/// \brief Creates predefined separator - structure in the logger.
void
writeSeparator
();
void
writeSeparator
();
/// \brief Inserts information about system parameters into logger.
/// \brief Inserts information about
various
system parameters into logger.
///
///
/// \param parameters
/// \param parameters
bool
writeSystemInformation
(
const
Config
::
ParameterContainer
&
parameters
);
bool
writeSystemInformation
(
const
Config
::
ParameterContainer
&
parameters
);
/////
/// \brief Inserts a line with current time into logger.
/// \brief Inserts a line with current time into logger.
///
///
/// \param label Description of the current time line.
/// \param label Description of the current time line.
...
...
This diff is collapsed.
Click to expand it.
src/UnitTests/TimerTest.cpp
+
6
−
2
View file @
4e387085
...
@@ -24,9 +24,13 @@ TEST( TimerTest, Constructor )
...
@@ -24,9 +24,13 @@ TEST( TimerTest, Constructor )
Timer
time
;
Timer
time
;
time
.
reset
();
time
.
reset
();
EXPECT_EQ
(
time
.
getRealTime
(),
0
);
EXPECT_EQ
(
time
.
getRealTime
(),
0
);
time
.
start
();
/*time.start();
EXPECT_FALSE(time.stopState);
time.stop();
time.stop();
EXPECT_NE
(
time
.
getRealTime
(),
0
);
EXPECT_TRUE(time.stopState);
EXPECT_NE(time.getRealTime(),0);*/
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment