mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
move semantics to table, PNums to LineSegments
This commit is contained in:
parent
78d0479993
commit
9968037361
@ -405,6 +405,13 @@ public:
|
||||
/// Creates table with a priori fixed entry sizes.
|
||||
DynamicTable (const Array<int> & entrysizes)
|
||||
: BaseDynamicTable (entrysizes, sizeof(T)) { ; }
|
||||
|
||||
DynamicTable & operator= (DynamicTable && tab2)
|
||||
{
|
||||
Swap (data, tab2.data);
|
||||
Swap (oneblock, tab2.oneblock);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Inserts element acont into row i. Does not test if already used.
|
||||
void Add (int i, const T & acont)
|
||||
|
@ -114,11 +114,22 @@ public:
|
||||
/// Creates table of size size
|
||||
inline TABLE (int size) : BASE_TABLE (size) { ; }
|
||||
|
||||
TABLE (TABLE && tab2)
|
||||
: BASE_TABLE(move(tab2))
|
||||
{ }
|
||||
|
||||
/// Creates fixed maximal element size table
|
||||
inline TABLE (const NgFlatArray<int,BASE> & entrysizes)
|
||||
: BASE_TABLE (NgFlatArray<int> (entrysizes.Size(), const_cast<int*>(&entrysizes[BASE])),
|
||||
sizeof(T))
|
||||
{ ; }
|
||||
|
||||
TABLE & operator= (TABLE && tab2)
|
||||
{
|
||||
BASE_TABLE::operator=(move(tab2));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/// Changes Size of table to size, deletes data
|
||||
inline void SetSize (int size)
|
||||
|
@ -1062,6 +1062,10 @@ namespace netgen
|
||||
return pnums[2].IsValid() ? 3 : 2;
|
||||
}
|
||||
|
||||
auto PNums() const { return FlatArray<const PointIndex> (GetNP(), &pnums[0]); }
|
||||
auto PNums() { return FlatArray<PointIndex> (GetNP(), &pnums[0]); }
|
||||
|
||||
|
||||
ELEMENT_TYPE GetType() const
|
||||
{
|
||||
return pnums[2].IsValid() ? SEGMENT3 : SEGMENT;
|
||||
|
Loading…
Reference in New Issue
Block a user