Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
Fauna::FeedHerbivores Class Reference

Function object to feed herbivores. More...

#include <feed_herbivores.h>

Public Member Functions

 FeedHerbivores (DistributeForage *distribute_forage)
 Constructor. More...
 
 FeedHerbivores (FeedHerbivores const &)=delete
 Delete copy constructor because of pointer ownership. More...
 
void operator= (FeedHerbivores const &)=delete
 Delete copy assignment because of pointer ownership. More...
 
 ~FeedHerbivores ()
 Destructor. More...
 
void operator() (HabitatForage &available, const HerbivoreVector &herbivores) const
 Feed the herbivores. More...
 

Private Attributes

std::unique_ptr< DistributeForagedistribute_forage
 

Detailed Description

Function object to feed herbivores.

Constructor & Destructor Documentation

◆ FeedHerbivores() [1/2]

FeedHerbivores::FeedHerbivores ( DistributeForage distribute_forage)

Constructor.

Parameters
distribute_forageStrategy object for calculating the forage portions. This must be a newly created object. It will be owned by the FeedHerbivores object.
Exceptions
std::invalid_argumentIf distribute_forage==NULL.

◆ FeedHerbivores() [2/2]

Fauna::FeedHerbivores::FeedHerbivores ( FeedHerbivores const &  )
delete

Delete copy constructor because of pointer ownership.

◆ ~FeedHerbivores()

FeedHerbivores::~FeedHerbivores ( )

Destructor.

Member Function Documentation

◆ operator()()

void FeedHerbivores::operator() ( HabitatForage available,
const HerbivoreVector herbivores 
) const

Feed the herbivores.

Parameters
[in,out]availableAvailable forage mass in the habitat. This will be reduced by the amount of eaten forage.
[in,out]herbivoresHerbivore objects that are being fed by calling HerbivoreInterface::eat().

◆ operator=()

void Fauna::FeedHerbivores::operator= ( FeedHerbivores const &  )
delete

Delete copy assignment because of pointer ownership.

Member Data Documentation

◆ distribute_forage

std::unique_ptr<DistributeForage> Fauna::FeedHerbivores::distribute_forage
private

The documentation for this class was generated from the following files: