9 throw Error(
"cannot squash zero resources together");
13 for (
int i = 1; i < ps.size(); ++i) {
21 throw Error(
"cannot squash zero resources together");
25 for (
int i = 1; i < ms.size(); ++i) {
33 throw Error(
"cannot squash zero resources together");
36 std::vector<Material::Ptr> mats = ::cyclus::ResCast<Material>(rs);
37 if (mats[0] != NULL) {
40 std::vector<Product::Ptr> prods = ::cyclus::ResCast<Product>(rs);
41 if (prods[0] != NULL) {
45 throw Error(
"cannot squash resource type " + rs[0]->type());
48 std::vector<Resource::Ptr>
ResCast(std::vector<Material::Ptr> rs) {
49 std::vector<Resource::Ptr> casted;
50 for (
int i = 0; i < rs.size(); ++i) {
51 casted.push_back(boost::dynamic_pointer_cast<Resource>(rs[i]));
56 std::vector<Resource::Ptr>
ResCast(std::vector<Product::Ptr> rs) {
57 std::vector<Resource::Ptr> casted;
58 for (
int i = 0; i < rs.size(); ++i) {
59 casted.push_back(boost::dynamic_pointer_cast<Resource>(rs[i]));
64 std::vector<Resource::Ptr>
ResCast(std::vector<Resource::Ptr> rs) {
A generic mechanism to manually manage exceptions.
boost::shared_ptr< Material > Ptr
boost::shared_ptr< Product > Ptr
boost::shared_ptr< Resource > Ptr
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.