Skip to content

Commit 66e4fff

Browse files
committed
solved clang tidy cart_cell.h and cart_tumor.h
1 parent b30d84c commit 66e4fff

File tree

7 files changed

+2024
-26
lines changed

7 files changed

+2024
-26
lines changed

clang_output.txt

Lines changed: 1959 additions & 0 deletions
Large diffs are not rendered by default.

src/cart_cell.h

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222
#ifndef CART_CELL_H_
2323
#define CART_CELL_H_
2424

25-
#include "biodynamo.h"
25+
#include "core/agent/agent.h"
26+
#include "core/agent/cell.h"
27+
#include "core/behavior/behavior.h"
28+
#include "core/diffusion/diffusion_grid.h"
29+
#include "core/container/math_array.h"
30+
#include "core/real_t.h"
31+
#include "core/interaction_force.h"
2632
#include "tumor_cell.h"
2733

34+
2835
namespace bdm {
2936

3037
/// Enumeration defining the possible states of a CAR-T cell
@@ -50,9 +57,13 @@ class CartCell : public Cell {
5057
BDM_AGENT_HEADER(CartCell, Cell, 1);
5158

5259
public:
53-
CartCell() {}
60+
CartCell() = default;
5461
explicit CartCell(const Real3& position);
55-
virtual ~CartCell() {}
62+
63+
// Copy and move constructors/destructors (assignment operators are deleted by base class)
64+
CartCell(const CartCell&) = default;
65+
CartCell(CartCell&&) = default;
66+
~CartCell() override = default;
5667

5768
/// Getters and Setters
5869
void SetState(CartCellState state) { state_ = state; }
@@ -172,60 +183,79 @@ class CartCell : public Cell {
172183

173184
private:
174185
/// Current state of the CAR-T cell
175-
CartCellState state_;
186+
// NOLINTNEXTLINE(readability-identifier-naming)
187+
CartCellState state_ = CartCellState::kAlive;
176188

177189
/// Timer to track time in the current state (in minutes)
178190
/// Used for apoptotic state timing
179-
int timer_state_;
191+
// NOLINTNEXTLINE(readability-identifier-naming)
192+
int timer_state_ = 0;
180193

181194
/// Pointer to the oxygen diffusion grid
182-
DiffusionGrid* oxygen_dgrid_;
195+
// NOLINTNEXTLINE(readability-identifier-naming)
196+
DiffusionGrid* oxygen_dgrid_ = nullptr;
183197

198+
// NOLINTNEXTLINE(readability-identifier-naming)
184199
/// Pointer to the immunostimulatory factor diffusion grid
185-
DiffusionGrid* immunostimulatory_factor_dgrid_;
200+
// NOLINTNEXTLINE(readability-identifier-naming)
201+
DiffusionGrid* immunostimulatory_factor_dgrid_ = nullptr;
186202

187203
/// Flag indicating if the cell is attached to a tumor cell
188-
bool attached_to_tumor_cell_;
204+
// NOLINTNEXTLINE(readability-identifier-naming)
205+
bool attached_to_tumor_cell_ = false;
189206

190207
/// Current time until apoptosis
191-
real_t current_live_time_;
208+
// NOLINTNEXTLINE(readability-identifier-naming)
209+
real_t current_live_time_ = 0.0;
192210

193211
/// Fluid fraction of the cell volume
194-
real_t fluid_fraction_;
212+
// NOLINTNEXTLINE(readability-identifier-naming)
213+
real_t fluid_fraction_ = 0.0;
195214

196215
/// Volume of the nucleus
197-
real_t nuclear_volume_;
216+
// NOLINTNEXTLINE(readability-identifier-naming)
217+
real_t nuclear_volume_ = 0.0;
198218

199219
/// Target cytoplasm solid volume for exponential relaxation
200220
/// Used during volume changes following exponential relaxation equation
201-
real_t target_cytoplasm_solid_;
221+
// NOLINTNEXTLINE(readability-identifier-naming)
222+
real_t target_cytoplasm_solid_ = 0.0;
202223

203224
/// Target nucleus solid volume for exponential relaxation
204-
real_t target_nucleus_solid_;
225+
// NOLINTNEXTLINE(readability-identifier-naming)
226+
real_t target_nucleus_solid_ = 0.0;
205227

206228
/// Target fluid fraction for exponential relaxation
207-
real_t target_fraction_fluid_;
229+
// NOLINTNEXTLINE(readability-identifier-naming)
230+
real_t target_fraction_fluid_ = 0.0;
208231

209232
/// Target relation between cytoplasm and nucleus volumes
210-
real_t target_relation_cytoplasm_nucleus_;
233+
// NOLINTNEXTLINE(readability-identifier-naming)
234+
real_t target_relation_cytoplasm_nucleus_ = 0.0;
211235

212236
/// Velocity of the cell in the previous time step
213-
Real3 older_velocity_;
237+
// NOLINTNEXTLINE(readability-identifier-naming)
238+
Real3 older_velocity_ = {0.0, 0.0, 0.0};
214239

215240
/// Rate of oxygen consumption by the cell
216-
real_t oxygen_consumption_rate_;
241+
// NOLINTNEXTLINE(readability-identifier-naming)
242+
real_t oxygen_consumption_rate_ = 0.0;
217243

218244
/// Rate of immunostimulatory factor secretion by the cell
219-
real_t immunostimulatory_factor_secretion_rate_;
245+
// NOLINTNEXTLINE(readability-identifier-naming)
246+
real_t immunostimulatory_factor_secretion_rate_ = 0.0;
220247

221248
/// Constant 1 for oxygen consumption/secretion differential equation solution
222-
real_t constant1_oxygen_;
249+
// NOLINTNEXTLINE(readability-identifier-naming)
250+
real_t constant1_oxygen_ = 0.0;
223251

224252
/// Constant 2 for oxygen consumption/secretion differential equation solution
225-
real_t constant2_oxygen_;
253+
// NOLINTNEXTLINE(readability-identifier-naming)
254+
real_t constant2_oxygen_ = 0.0;
226255

227256
/// Pointer to the attached tumor cell
228-
TumorCell* attached_cell_;
257+
// NOLINTNEXTLINE(readability-identifier-naming)
258+
TumorCell* attached_cell_ = nullptr;
229259
};
230260

231261
/// Behavior class for controlling CAR-T cell state transitions
@@ -238,8 +268,11 @@ struct StateControlCart : public Behavior {
238268
BDM_BEHAVIOR_HEADER(StateControlCart, Behavior, 1);
239269

240270
StateControlCart() { AlwaysCopyToNew(); }
241-
242-
virtual ~StateControlCart() {}
271+
272+
// Copy and move constructors/destructors (assignment operators handled by base class)
273+
StateControlCart(const StateControlCart&) = default;
274+
StateControlCart(StateControlCart&&) = default;
275+
~StateControlCart() override = default;
243276

244277
/// Execute the state control behavior
245278
void Run(Agent* agent) override;

src/cart_tumor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#ifndef CART_TUMOR_H_
2222
#define CART_TUMOR_H_
2323

24-
#include "biodynamo.h"
25-
2624
namespace bdm {
2725

2826
/// List the diffused substances

src/forces_tumor_cart.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "forces_tumor_cart.h"
2323
#include <algorithm>
2424
#include <cmath>
25+
#include "core/container/math_array.h"
2526
#include "hyperparams.h"
2627
#include "tumor_cell.h"
2728
#include "utils_aux.h"

src/forces_tumor_cart.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "biodynamo.h"
2626
#include "core/interaction_force.h"
27+
#include "core/container/math_array.h"
2728

2829
namespace bdm {
2930

@@ -37,6 +38,10 @@ namespace bdm {
3738
class InteractionVelocity : public InteractionForce {
3839
public:
3940
InteractionVelocity() = default;
41+
InteractionVelocity(const InteractionVelocity&) = default;
42+
InteractionVelocity& operator=(const InteractionVelocity&) = default;
43+
InteractionVelocity(InteractionVelocity&&) = default;
44+
InteractionVelocity& operator=(InteractionVelocity&&) = default;
4045

4146
~InteractionVelocity() override = default;
4247

@@ -52,7 +57,7 @@ class InteractionVelocity : public InteractionForce {
5257
/// magnitude)
5358
Real4 Calculate(const Agent* lhs, const Agent* rhs) const override;
5459

55-
InteractionForce* NewCopy() const override;
60+
[[nodiscard]] InteractionForce* NewCopy() const override;
5661
};
5762

5863
} // namespace bdm

src/tumor_cell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define TUMOR_CELL_H_
2424

2525
#include "biodynamo.h"
26+
#include "core/container/math_array.h"
2627

2728
namespace bdm {
2829

src/utils_aux.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <tuple>
2727
#include <vector>
2828
#include "biodynamo.h"
29+
#include "core/container/math_array.h"
2930

3031
namespace bdm {
3132
/// Forward declaration of TumorCell class

0 commit comments

Comments
 (0)