2025-12-13 12:04:25 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Factory.mqh |
|
| | | //| Copyright 2025, Niquel Mendoza. |
|
| | | //| https://www.mql5.com/es/users/nique_372/news |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "Copyright 2025, Niquel Mendoza."
|
| | | #property link "https://www.mql5.com/es/users/nique_372/news"
|
| | | #property strict
|
| | |
|
| | | #ifndef MQLARTICLES_POSMGMT_CONDPARTIALS_BASE_FACTORY_MQH
|
| | | #define MQLARTICLES_POSMGMT_CONDPARTIALS_BASE_FACTORY_MQH
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Include |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "ConstantPartial.mqh"
|
| | |
|
2026-09-13 08:47:52 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | namespace TSN
|
| | | {
|
2025-12-13 12:04:25 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| CConditionalPartialsFactory class |
|
| | | //+------------------------------------------------------------------+
|
| | | class CConditionalPartialsFactory
|
| | | {
|
| | | public:
|
| | | CConditionalPartialsFactory(void) {}
|
| | | ~CConditionalPartialsFactory(void) {}
|
2026-01-31 19:44:40 -05:00 | | | static CConditionalPartials* Create(ENUM_TYPE_CONDITIONAL_PARTIAL_CLASS type );
|
2025-12-13 12:04:25 -05:00 | | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
| | | //| Function to return a dynamic instance of type |
|
| | | //| CConditionalPartials* |
|
| | | //| Inputs: |
|
| | | //| - ENUM_TYPE_CONDITIONAL_PARTIAL_CLASS type: Type of base class |
|
| | | //| that will serve as the manager for the conditional |
|
| | | //| partial closure class. |
|
| | | //| Outputs: |
|
| | | //| - On success, dynamic instance of type CConditionalPartials, |
|
| | | //| otherwise NULL |
|
| | | //+------------------------------------------------------------------+
|
2026-01-31 19:44:40 -05:00 | | | static CConditionalPartials* CConditionalPartialsFactory::Create(ENUM_TYPE_CONDITIONAL_PARTIAL_CLASS type)
|
2025-12-13 12:04:25 -05:00 | | | {
|
| | | switch(type)
|
| | | {
|
| | | case CONDITIONAL_PARTIAL_CLASS_TYPE_BASE:
|
2026-01-31 19:44:40 -05:00 | | | return new CConditionalPartials();
|
2025-12-13 12:04:25 -05:00 | | | case CONDITIONAL_PARTIAL_CLASS_TYPE_CONSTANT:
|
2026-01-31 19:44:40 -05:00 | | | return new CConditionalPartialsConst();
|
2025-12-13 12:04:25 -05:00 | | | default:
|
| | | FastLog(FUNCION_ACTUAL, CRITICAL_ERROR_TEXT, StringFormat("Class type %s\nInvalid", EnumToString(type)));
|
| | | Remover();
|
| | | return NULL;
|
| | | }
|
| | | }
|
2026-09-13 08:47:52 -05:00 | | | }
|
2025-12-13 12:04:25 -05:00 | | | #endif // MQLARTICLES_POSMGMT_CONDPARTIALS_BASE_FACTORY_MQH
|
| | | //+------------------------------------------------------------------+
|