30#ifndef EXTERNALMODULE_H
31#define EXTERNALMODULE_H
46 void* ext_library =
nullptr;
47 void* ext_creator =
nullptr;
49 bool locate_module(
string);
64 void new_object(unique_ptr<Element>&, istringstream&)
const;
65 void new_object(unique_ptr<Load>&, istringstream&)
const;
67 void new_object(unique_ptr<Section>&, istringstream&)
const;
68 void new_object(unique_ptr<Solver>&, istringstream&)
const;
69 void new_object(unique_ptr<Amplitude>&, istringstream&)
const;
70 void new_object(unique_ptr<Modifier>&, istringstream&)
const;
71 void new_object(unique_ptr<Constraint>&, istringstream&)
const;
73 void new_adapter(unique_ptr<Element>&, istringstream&)
const;
74 void new_adapter(unique_ptr<Load>&, istringstream&)
const;
76 void new_adapter(unique_ptr<Section>&, istringstream&)
const;
77 void new_adapter(unique_ptr<Solver>&, istringstream&)
const;
78 void new_adapter(unique_ptr<Amplitude>&, istringstream&)
const;
79 void new_adapter(unique_ptr<Modifier>&, istringstream&)
const;
80 void new_adapter(unique_ptr<Constraint>&, istringstream&)
const;
85 template<
typename T>
static void object(unique_ptr<T>&,
const shared_ptr<DomainBase>&,
const string&, istringstream&);
88template<
typename T>
void load::object(unique_ptr<T>& new_object,
const shared_ptr<DomainBase>& domain,
const string&
id, istringstream& command) {
91 for(
const auto& I : domain->get_external_module_pool())
92 if(
is_equal(I->library_name,
id) || I->locate_cpp_module(
id) || I->locate_c_module(
id)) {
99 if(loaded || domain->insert(make_shared<ExternalModule>(
id)))
100 for(
const auto& I : domain->get_external_module_pool()) {
101 if(I->locate_cpp_module(
id)) I->new_object(new_object, command);
102 if(new_object !=
nullptr)
break;
103 if(I->locate_c_module(
id)) I->new_adapter(new_object, command);
104 if(new_object !=
nullptr)
break;
An Amplitude class that can generate Amplitude pattern.
Definition: Amplitude.h:67
A Constraint class.
Definition: Constraint.h:36
A Element class.
Definition: Element.h:117
A ExternalModule class handles communication between the main program and external library.
Definition: ExternalModule.h:45
A Load class.
Definition: Load.h:37
A Material abstract base class.
Definition: Material.h:111
A Modifier class.
Definition: Modifier.h:36
A Section class.
Definition: Section.h:77
A Solver class defines solvers used in analysis.
Definition: Solver.h:38
Definition: ExternalModule.h:83
ExternalModule & operator=(const ExternalModule &)=delete
~ExternalModule()
Definition: ExternalModule.cpp:94
ExternalModule(string)
Definition: ExternalModule.cpp:54
bool locate_c_module(const string &)
Definition: ExternalModule.cpp:102
void new_object(unique_ptr< Element > &, istringstream &) const
Definition: ExternalModule.cpp:106
ExternalModule(const ExternalModule &)=delete
ExternalModule(ExternalModule &&)=delete
bool locate_cpp_module(const string &)
Definition: ExternalModule.cpp:104
const string library_name
Definition: ExternalModule.h:52
static void object(unique_ptr< T > &, const shared_ptr< DomainBase > &, const string &, istringstream &)
Definition: ExternalModule.h:88
ExternalModule & operator=(ExternalModule &&)=delete
void new_adapter(unique_ptr< Element > &, istringstream &) const
Definition: ExternalModule.cpp:122
bool is_equal(const char *A, const char *B)
Definition: utility.cpp:103