MAK Legion 1.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
take.cxx File Reference

Contains the simple take example for Legion ownership acquisition. More...

Functions

const std::string theName ("take")
 
std::string thePrivateData ("#Test Private Data#")
 
Legion::Span< char > thePrivateDataSpan (thePrivateData.c_str(), thePrivateData.length())
 
void processArgumentsAndConfiguration (int argc, char *argv[], Legion::Configuration &configuration)
 
void setMinMaxBoundary (Legion::BoundarySpatialPlanar &boundary, float minX, float minY, float maxX, float maxY)
 
void checkConsoleCommands (MAK::DtCommandParser &commandInput)
 
void requestOwnership (Legion::OwnershipManager *ownershipManager, const LOM::ReadEntityRepository &entityToAcquire)
 
void processOwnershipAcquisitionRejected (Legion::TransactionIdentifier transactionId, Legion::Span< Legion::GlobalIdentifier > globalIds, Legion::Span< char > privateData)
 
void processOwnershipAcquired (Legion::TransactionIdentifier transactionId, Legion::Span< Legion::GlobalIdentifier > globalIds, Legion::Span< char > privateData)
 
const std::string & getPrivateData (Legion::Span< char > privateData)
 
int main (int argc, char *argv[])
 

Variables

std::string theConfigFile = "legionExamples.lua"
 
float theFrameRate = 10.0
 
float theReferenceLatitude = 0.0
 
float theReferenceLongitude = 0.0
 
Legion::SimulationDatabasetheSimDatabase = nullptr
 
LOM::EntityTypeView * theEntityView = nullptr
 
LOM::WriteEntityRepository theAcquiredEntity
 
Legion::TransactionIdentifier theOwnershipTransactionId = 0
 
bool theDoRequestAcquisition = false
 
bool theDoAcquireOwnership = false
 
bool theDoDestroy = false
 

Detailed Description

Contains the simple take example for Legion ownership acquisition.

To start, no entity is simulated. The invocation of a requestAcquisition service is manually triggered via the command prompt (pressing the 't' key). The request is not made unless there are entities available to be taken. After acquiring an entity via the OwnershipAcquired callback, the entity is simulated to move to a destination. Upon reaching the destination, the entity is destroyed and a new cycle of acquiring and simulating can be initiated. A simulating entity may be preemptively destroyed by pressing the 'd' key.

Function Documentation

void checkConsoleCommands ( MAK::DtCommandParser &  commandInput)

Referenced by main().

const std::string& getPrivateData ( Legion::Span< char >  privateData)
int main ( int  argc,
char *  argv[] 
)
void processArgumentsAndConfiguration ( int  argc,
char *  argv[],
Legion::Configuration configuration 
)
void processOwnershipAcquired ( Legion::TransactionIdentifier  transactionId,
Legion::Span< Legion::GlobalIdentifier globalIds,
Legion::Span< char >  privateData 
)
void processOwnershipAcquisitionRejected ( Legion::TransactionIdentifier  transactionId,
Legion::Span< Legion::GlobalIdentifier globalIds,
Legion::Span< char >  privateData 
)

Referenced by main().

void requestOwnership ( Legion::OwnershipManager ownershipManager,
const LOM::ReadEntityRepository &  entityToAcquire 
)
void setMinMaxBoundary ( Legion::BoundarySpatialPlanar boundary,
float  minX,
float  minY,
float  maxX,
float  maxY 
)
const std::string theName ( "take"  )
std::string thePrivateData ( "#Test Private Data#"  )
Legion::Span<char> thePrivateDataSpan ( thePrivateData.  c_str(),
thePrivateData.  length() 
)

Referenced by requestOwnership().

Variable Documentation

LOM::WriteEntityRepository theAcquiredEntity
std::string theConfigFile = "legionExamples.lua"
bool theDoAcquireOwnership = false
bool theDoDestroy = false
bool theDoRequestAcquisition = false
LOM::EntityTypeView* theEntityView = nullptr
float theFrameRate = 10.0
Legion::TransactionIdentifier theOwnershipTransactionId = 0
float theReferenceLatitude = 0.0
float theReferenceLongitude = 0.0
Legion::SimulationDatabase* theSimDatabase = nullptr

Referenced by main().


Document ID: Generated on Wed May 26 15:17:05 EDT 2021 from SVN revision 229676
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)