Last active
February 11, 2016 21:48
-
-
Save mitchute/d554da92ae701009aa10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In header | |
class PipingSystemDomainClass : public BaseDomainClass | |
{ | |
public: | |
// Members | |
// Default Constructor | |
PipingSystemDomainClass(){} | |
// Destructor | |
~PipingSystemDomainClass(){} | |
// Member Functions | |
}; | |
extern std::vector< PipingSystemDomainClass > PipingSystemSegments; | |
PipingSystemDomainClass | |
GetPipingSystemDomainAndInit( | |
std::string const & EquipName, // name of the Pipe Heat Transfer | |
int & EqNum // index in local derived types for external calling | |
); | |
// In .cc file | |
PipingSystemDomainClass | |
GetPipingSystemDomainAndInit( | |
std::string const & EquipName, // name of the Pipe Heat Transfer | |
int & EqNum // index in local derived types for external calling | |
) | |
{ | |
// Check if this instance of this model has already been retrieved | |
for ( int i = 0; i < numPipingSystemDomains; ++i ) { | |
// Check if the type and name match | |
if ( EquipName == PipingSystemDomains[i].Name ) { | |
return &PipingSystemDomains[i]; | |
} | |
} | |
// Object not found | |
// New pointer for this model object | |
thisModel & new PipingSystemDomainClass(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment