Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
Block.cc
Go to the documentation of this file.
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
23
24#include "Block.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Alien
30{
31
32using namespace Arccore;
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
41{
46
53 static Block::Internal* newFixedSizeBlock(Integer sizeX, Integer sizeY);
54};
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
61{
62 return new Block::Internal{ sizeX, sizeY };
63}
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68Block::Block(const Block& block)
70{}
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75Block::Block(Integer block_size)
76: m_internal(Internal::newFixedSizeBlock(block_size, block_size))
77{}
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82Block::Block(Integer block_sizeX, Integer block_sizeY)
83: m_internal(Internal::newFixedSizeBlock(block_sizeX, block_sizeY))
84{}
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89Integer
91{
92 return m_internal->m_block_size_x;
93}
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98Integer
100{
101 return m_internal->m_block_size_x;
102}
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107Integer
109{
110 return m_internal->m_block_size_y;
111}
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
115
116std::shared_ptr<Block>
118{
119 return std::make_shared<Block>(*this);
120}
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125} // namespace Alien
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
Block.h.
Arccore::Integer size() const
Get square block size.
Definition Block.cc:90
Arccore::Integer sizeX() const
Get rectangular block size in the "X" direction.
Definition Block.cc:99
Arccore::Integer sizeY() const
Get rectangular block size in the "Y" direction.
Definition Block.cc:108
Block(Arccore::Integer block_size)
Square block constructor.
std::shared_ptr< Block > clone() const
Clone this object.
Definition Block.cc:117
std::shared_ptr< Internal > m_internal
Actual implementation.
Definition Block.h:100
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17
Internal structure for square or rectangular blocks.
Definition Block.cc:41
static Block::Internal * newFixedSizeBlock(Integer sizeX, Integer sizeY)
Creates a new block.
Definition Block.cc:60
Integer m_block_size_y
Block size in "Y" direction.
Definition Block.cc:45
Integer m_block_size_x
Block size in "X" direction.
Definition Block.cc:43