Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
21326868
Commit
21326868
authored
Jun 16, 2010
by
Ivan Donchevskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes for CycleStorage iterator
parent
77fd8250
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
13 deletions
+47
-13
libuniset.spec
conf/libuniset.spec
+4
-1
Storages.h
include/Storages.h
+14
-0
CycleStorage.cc
src/Various/CycleStorage.cc
+29
-12
No files found.
conf/libuniset.spec
View file @
21326868
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.98
Release: eter
2
Release: eter
4
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
@@ -184,6 +184,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Wed Jun 16 2010 Ivan Donchevskiy <yv@etersoft.ru> 0.98-eter3
- new build
* Tue Jun 01 2010 Vitaly Lipatov <lav@altlinux.ru> 0.98-eter2
- fixed bug in uniset-codegen
- minor fixes in SM (add virtual function)
...
...
include/Storages.h
View file @
21326868
...
...
@@ -179,6 +179,13 @@ class CycleStorage
inline
bool
operator
==
(
const
Self
&
other
)
const
{
if
(
str
==
NULL
||
other
.
str
==
NULL
)
{
if
(
str
==
NULL
&&
other
.
str
==
NULL
)
return
true
;
else
return
false
;
}
if
(
memcmp
(
str
,
other
.
str
,
cs
->
getInfSize
())
==
0
)
return
true
;
return
false
;
...
...
@@ -186,6 +193,13 @@ class CycleStorage
inline
bool
operator
!=
(
const
Self
&
other
)
const
{
if
(
str
==
NULL
||
other
.
str
==
NULL
)
{
if
(
str
==
NULL
&&
other
.
str
==
NULL
)
return
false
;
else
return
true
;
}
if
(
memcmp
(
str
,
other
.
str
,
cs
->
getInfSize
())
==
0
)
return
false
;
return
true
;
...
...
src/Various/CycleStorage.cc
View file @
21326868
...
...
@@ -493,9 +493,13 @@ bool CycleStorage::setSize(int count)
/*! Некоторые операции для итератора */
CycleStorage
::
iterator
&
CycleStorage
::
iterator
::
operator
++
()
{
if
(
current
>=
cs
->
getSize
()
)
throw
"Trying to perform operator ++ at the end of collection"
;
current
++
;
if
(
current
>=
cs
->
getSize
()
)
{
str
=
NULL
;
current
=
cs
->
getSize
();
return
*
this
;
}
cs
->
readRow
(
current
,
str
);
return
*
this
;
}
...
...
@@ -503,18 +507,26 @@ CycleStorage::iterator& CycleStorage::iterator::operator++()
CycleStorage
::
iterator
CycleStorage
::
iterator
::
operator
++
(
int
)
{
Self
temp
=
*
this
;
if
(
current
>=
cs
->
getSize
())
throw
"Trying to perform operator ++ at the end of collection"
;
current
++
;
cs
->
readRow
(
current
,
str
);
temp
.
current
++
;
if
(
temp
.
current
>=
temp
.
cs
->
getSize
())
{
temp
.
str
=
NULL
;
temp
.
current
=
temp
.
cs
->
getSize
();
return
temp
;
}
temp
.
cs
->
readRow
(
current
,
str
);
return
temp
;
}
CycleStorage
::
iterator
&
CycleStorage
::
iterator
::
operator
--
()
{
if
(
current
<=
0
)
throw
"Trying to perform operator -- at the begining of collection"
;
current
--
;
if
(
current
<=
0
)
{
str
=
NULL
;
current
=
-
1
;;
return
*
this
;
}
cs
->
readRow
(
current
,
str
);
return
*
this
;
}
...
...
@@ -522,9 +534,13 @@ CycleStorage::iterator& CycleStorage::iterator::operator--()
CycleStorage
::
iterator
CycleStorage
::
iterator
::
operator
--
(
int
)
{
Self
temp
=
*
this
;
if
(
current
<=
0
)
throw
"Trying to perform operator -- at the begining of collection"
;
current
--
;
cs
->
readRow
(
current
,
str
);
temp
.
current
--
;
if
(
temp
.
current
<=
0
)
{
temp
.
str
=
NULL
;
temp
.
current
=
-
1
;
return
temp
;
}
temp
.
cs
->
readRow
(
current
,
str
);
return
temp
;
}
\ No newline at end of file
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