Mesh Oriented datABase
(version 5.5.1)
An array-based unstructured mesh library
EntitySequence.cpp
Go to the documentation of this file.
1
#include "
EntitySequence.hpp
"
2
#include "
SequenceData.hpp
"
3
4
namespace
moab
5
{
6
7
bool
EntitySequence::using_entire_data
()
const
8
{
9
return
start_handle
() ==
data
()->
start_handle
() &&
end_handle
() ==
data
()->
end_handle
();
10
}
11
12
int
EntitySequence::values_per_entity
()
const
13
{
14
return
0;
15
}
16
17
ErrorCode
EntitySequence::pop_back
(
EntityID
count )
18
{
19
EntityHandle
new_end =
endHandle
- count;
20
if
( new_end <
startHandle
)
return
MB_FAILURE;
21
22
endHandle
= new_end;
23
return
MB_SUCCESS
;
24
}
25
26
ErrorCode
EntitySequence::pop_front
(
EntityID
count )
27
{
28
EntityHandle
new_start =
startHandle
+ count;
29
if
( new_start >
endHandle
)
return
MB_FAILURE;
30
31
startHandle
= new_start;
32
return
MB_SUCCESS
;
33
}
34
35
ErrorCode
EntitySequence::prepend_entities
(
EntityID
count )
36
{
37
EntityHandle
new_start =
startHandle
- count;
38
if
( new_start <
data
()->
start_handle
() )
return
MB_FAILURE;
39
40
startHandle
= new_start;
41
return
MB_SUCCESS
;
42
}
43
44
ErrorCode
EntitySequence::append_entities
(
EntityID
count )
45
{
46
EntityHandle
new_end =
endHandle
+ count;
47
if
( new_end >
data
()->
end_handle
() )
return
MB_FAILURE;
48
49
endHandle
= new_end;
50
return
MB_SUCCESS
;
51
}
52
53
ErrorCode
EntitySequence::merge
(
EntitySequence
& other )
54
{
55
if
(
sequenceData
!= other.
sequenceData
)
return
MB_FAILURE;
56
if
(
end_handle
() + 1 == other.
start_handle
() )
57
{
58
endHandle
= other.
end_handle
();
59
other.
startHandle
= other.
end_handle
() + 1;
60
}
61
else
if
(
start_handle
() == other.
end_handle
() + 1 )
62
{
63
startHandle
= other.
start_handle
();
64
other.
endHandle
= other.
start_handle
() - 1;
65
}
66
else
67
return
MB_FAILURE;
68
return
MB_SUCCESS
;
69
}
70
71
unsigned
long
EntitySequence::get_per_entity_memory_use
(
EntityHandle
,
EntityHandle
)
const
72
{
73
return
0;
74
}
75
76
}
// namespace moab
src
EntitySequence.cpp
Generated on Tue Oct 29 2024 02:05:40 for Mesh Oriented datABase by
1.9.1.