Открытые члены | Закрытые члены | Закрытые данные

Класс nitro::MVC

#include <utilities/mvc/mvc_core.h>

Граф связей класса nitro::MVC:
Collaboration graph
[см. легенду]

Полный список членов класса

Открытые члены

 MVC (void)
 MVC (nitro::XMLTag &ManifestPart, MVC *theRootMVC=NULL)
void AddModel (const char *ModelName, nitro::ModelInterface *Model)
void AddView (const char *ViewName, ViewInterface *View)
void AddController (const char *ControllerName, nitro::ControllerInterface *Controller)
nitro::ModelInterfaceGetModel (const char *ModelName)
nitro::ViewInterfaceGetView (const char *ViewName)
nitro::ControllerInterfaceGetController (const char *ControllerName)
nitro::ModelInterfaceGetModel (const std::string &ModelName)
nitro::ViewInterfaceGetView (const std::string &ViewName)
nitro::ControllerInterfaceGetController (const std::string &ControllerName)
bool ExecuteCommand (const char *Command, const void *Param1=NULL, const void *Param2=NULL)
void LoadModules (const char *Path, const nitro::XMLTag &ManifestPart)
void LoadModule (const char *Path, const nitro::XMLTag &ManifestPart)
void LoadModules (const std::string &Path, const nitro::XMLTag &ManifestPart)
void Create (const char *Path=NULL, MVC *theRootMVC=NULL)
void Create (const std::string &Path, MVC *theRootMVC=NULL)
void Create (nitro::XMLTag &ManifestPart, MVC *theRootMVC=NULL)
int Entry (MAIN_FUNC_PARAMS_LIST)
const char * GetStartupViewName (void) const
const char * GetStartupControllerName (void) const
const char * GetStartupControllerCommand (void) const
virtual ~MVC ()

Закрытые члены

void LoadModules (const std::vector< std::string > &ModulePaths, const nitro::XMLTag &ManifestPart)

Закрытые данные

nitro::ObjectManager
< nitro::ModelInterface
Models
nitro::ObjectManager
< nitro::ViewInterface
Views
nitro::ObjectManager
< nitro::ControllerInterface
Controllers
nitro::ObjectManager< nitro::MVCMVCObjects
nitro::DynamicLibManager Modules
MVCRootMVC
std::string StartupViewName
std::string StartupControllerName
std::string StartupControllerCommand

Подробное описание

Класс объединяющий модель вид и контроллер.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 65


Конструктор(ы)

nitro::MVC::MVC ( void   ) 

Конструктор.

Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 20

Перекрестные ссылки nitro::exception::code(), RootMVC, StartupControllerCommand, StartupControllerName, StartupViewName и nitro::exception::what().

Используется в Create().

        {
                try
                {
                        RootMVC = NULL;
                        StartupViewName = "";
                        StartupControllerName = "";
                        StartupControllerCommand = "startup";
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::MVC( void )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::MVC( void )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::MVC::MVC ( nitro::XMLTag ManifestPart,
MVC theRootMVC = NULL 
)

Конструктор.

Аргументы:
ManifestPart - Кусок манифеста.
theRootMVC - Корневой MVC.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 39

Перекрестные ссылки nitro::exception::code(), Create(), RootMVC, StartupControllerCommand, StartupControllerName, StartupViewName и nitro::exception::what().

        {
                try
                {
                        RootMVC = theRootMVC;

                        StartupViewName = "";
                        StartupControllerName = "";
                        StartupControllerCommand = "startup";

                        Create( ManifestPart );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::MVC( nitro::XMLTag & ManifestPart )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::MVC( nitro::XMLTag & ManifestPart )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::MVC::~MVC (  )  [virtual]

Деструктор.

Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 485

        {
                try
                {
                }
                catch( ... )
                {
                }
        }


Методы

void nitro::MVC::AddController ( const char *  ControllerName,
nitro::ControllerInterface Controller 
)

Функция добавления контроллера.

Аргументы:
ControllerName - Имя контроллера.
Controller - Контроллер.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 93

Перекрестные ссылки nitro::ObjectManager< managing_class >::AddObject(), nitro::exception::code(), Controllers и nitro::exception::what().

Используется в LoadModules().

        {
                try
                {
                        Controllers.AddObject( ControllerName , Controller );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::AddController( const char * ControllerName , nitro::ControllerInterface * Controller )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::AddController( const char * ControllerName , nitro::ControllerInterface * Controller )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::AddModel ( const char *  ModelName,
nitro::ModelInterface Model 
)

Функция добавления модели.

Аргументы:
ModelName - Имя модели.
Model - Модель.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 61

Перекрестные ссылки nitro::ObjectManager< managing_class >::AddObject(), nitro::exception::code(), Models и nitro::exception::what().

Используется в LoadModules().

        {
                try
                {
                        Models.AddObject( ModelName , Model );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::AddModel( const char * ModelName , nitro::ModelInterface * Model )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::AddModel( const char * ModelName , nitro::ModelInterface * Model )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::AddView ( const char *  ViewName,
nitro::ViewInterface View 
)

Функция добавления вида.

Аргументы:
ViewName - Имя вида.
View - Вид.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 77

Перекрестные ссылки nitro::ObjectManager< managing_class >::AddObject(), nitro::exception::code(), Views и nitro::exception::what().

Используется в LoadModules() и nitro::Application::OnInit().

        {
                try
                {
                        Views.AddObject( ViewName , View );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::AddView( const char * ViewName , nitro::ViewInterface * View )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::AddView( const char * ViewName , nitro::ViewInterface * View )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::Create ( nitro::XMLTag ManifestPart,
MVC theRootMVC = NULL 
)

Функция конструирования объекта по манифест.

Аргументы:
ManifestPart - Кусок манифеста.
theRootMVC - Корневой MVC.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 353

Перекрестные ссылки nitro::ObjectManager< managing_class >::AddObject(), nitro::exception::code(), nitro::XMLTag::CountOfChildTags(), nitro::XMLTag::GetAttribute_string(), LoadModule(), LoadModules(), MVC(), MVCObjects, RootMVC, StartupControllerCommand, StartupControllerName, StartupViewName и nitro::exception::what().

        {
                try
                {
                        RootMVC = theRootMVC;
                        for( std::size_t i( 0 ) ; i < ManifestPart.CountOfChildTags() ; i++ )
                        {
                                if( ManifestPart[ i ].Name == "setlocale" )
                                {
                                        setlocale( LC_ALL , ManifestPart[ i ].GetAttribute_string( "locale" ) );
                                        continue;
                                }

                                if( ManifestPart[ i ].Name == "dll" )
                                {
                                        LoadModule( ManifestPart[ i ].GetAttribute_string( "value" ) , ManifestPart[ i ] );
                                        continue;
                                }

                                if( ManifestPart[ i ].Name == "dlls" )
                                {
                                        LoadModules( ManifestPart[ i ].GetAttribute_string( "value" ) , ManifestPart[ i ] );
                                        continue;
                                }
                                
                                if( ManifestPart[ i ].Name == "mvc" )
                                {
                                        if( ManifestPart[ i ].AttributeExists( "path" ) )
                                        {
                                                nitro::XMLFile                  MVCManifest( ManifestPart[ i ].GetAttribute_string( "path" ) );
                                                MVCObjects.AddObject( ManifestPart[ i ].GetAttribute_string( "name" ) , new MVC( MVCManifest[ 0 ] , this ) );
                                        }
                                        
                                        MVCObjects.AddObject( ManifestPart[ i ].GetAttribute_string( "name" ) , new MVC( ManifestPart[ i ] , this ) );
                                        continue;
                                }

                                if( ManifestPart[ i ].Name == "main" )
                                {
                                        if( ManifestPart[ i ].AttributeExists( "startup_view" ) )
                                        {
                                                StartupViewName = ManifestPart[ i ].GetAttribute_string( "startup_view" );
                                        }

                                        if( ManifestPart[ i ].AttributeExists( "startup_controller" ) )
                                        {
                                                StartupControllerName = ManifestPart[ i ].GetAttribute_string( "startup_controller" );
                                        }

                                        if( ManifestPart[ i ].AttributeExists( "startup_controller_command" ) )
                                        {
                                                StartupControllerCommand = ManifestPart[ i ].GetAttribute_string( "startup_controller_command" );
                                        }

                                        continue;
                                }
                        }
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::Create( nitro::XMLTag & ManifestPart , MVC * theRootMVC /* = NULL */ )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::Create( nitro::XMLTag & ManifestPart , MVC * theRootMVC /* = NULL */ )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::Create ( const char *  Path = NULL,
MVC theRootMVC = NULL 
)

Функция конструирования объекта по манифест.

Аргументы:
Path - Путь к манифесту.
theRootMVC - Корневой MVC.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 305

Перекрестные ссылки nitro::exception::code(), nitro::File::FileExists(), nitro::XMLFile::GetRoot(), LoadModules(), nitro::XMLFile::LoadXML() и nitro::exception::what().

Используется в Create() и MVC().

        {
                try
                {
                        std::string                     ManifestPath( "./conf/mvc_config.xml" );
                        if( Path != NULL && strlen( Path ) != 0 )
                        {
                                ManifestPath = Path;
                        }
                        
                        nitro::XMLFile          Manifest;

                        if( nitro::File::FileExists( ManifestPath ) )
                        {
                                Manifest.LoadXML( ManifestPath );
                                Create( Manifest.GetRoot() , theRootMVC );
                        }
                        else
                        {
                                this->LoadModules( std::string( "./bin" ) , Manifest );
                        }
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::Create( const char * Path /* = NULL */ , MVC * theRootMVC /* = NULL */ )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::Create( const char * Path /* = NULL */ , MVC * theRootMVC /* = NULL */ )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::Create ( const std::string &  Path,
MVC theRootMVC = NULL 
)

Функция конструирования объекта по манифест.

Аргументы:
Path - Путь к манифесту.
theRootMVC - Корневой MVC.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 337

Перекрестные ссылки nitro::exception::code(), Create() и nitro::exception::what().

        {
                try
                {
                        Create( Path.c_str() , theRootMVC );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::Create( const std::string & Path , MVC * theRootMVC /* = NULL */ )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::Create( const std::string & Path , MVC * theRootMVC /* = NULL */ )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

int nitro::MVC::Entry ( MAIN_FUNC_PARAMS_LIST   ) 

Точка входа в программу.

Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 421

Перекрестные ссылки nitro::exception::code() и nitro::exception::what().

        {
                try
                {
                        return( wxEntry( MAIN_FUNC_VALUES_LIST ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::Entry( MAIN_FUNC_PARAMS_LIST )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::Entry( MAIN_FUNC_PARAMS_LIST )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

bool nitro::MVC::ExecuteCommand ( const char *  Command,
const void *  Param1 = NULL,
const void *  Param2 = NULL 
)

Функция управления системой.

Аргументы:
Command - Название команды.
Param1 - Первый параметр.
Param2 - Второй параметр.
Возвращает:
- false если команда была успешно обработана.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 205

Перекрестные ссылки nitro::exception::code(), Controllers, nitro::ObjectManagerBasic< managing_class >::Count(), Views и nitro::exception::what().

        {
                try
                {
                        for( std::size_t i( 0 ) ; i < Controllers.Count() ; i++ )
                        {
                                if( Controllers[ i ]->ExecuteCommand( Command , Param1 , Param2 ) == false )
                                {
                                        return( false );
                                }
                        }

                        for( std::size_t i( 0 ) ; i < Views.Count() ; i++ )
                        {
                                if( Views[ i ]->ExecuteCommand( Command , Param1 , Param2 ) == false )
                                {
                                        return( false );
                                }
                        }

                        return( true );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::ExecuteCommand( const char * Command , const void * Param1 , const void * Param2  )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::ExecuteCommand( const char * Command , const void * Param1 , const void * Param2 )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ControllerInterface * nitro::MVC::GetController ( const std::string &  ControllerName  ) 

Функция получения контроллера.

Аргументы:
ControllerName - Имя контроллера.
Возвращает:
Контроллер.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 189

Перекрестные ссылки nitro::exception::code(), Controllers и nitro::exception::what().

        {
                try
                {
                        return( Controllers[ ControllerName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetController( const std::string & ControllerName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetController( const std::string & ControllerName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ControllerInterface * nitro::MVC::GetController ( const char *  ControllerName  ) 

Функция получения контроллера.

Аргументы:
ControllerName - Имя контроллера.
Возвращает:
Контроллер.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 141

Перекрестные ссылки nitro::exception::code(), Controllers и nitro::exception::what().

Используется в LoadModules() и nitro::Application::OnInit().

        {
                try
                {
                        return( Controllers[ ControllerName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetController( const char * ControllerName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetController( const char * ControllerName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ModelInterface * nitro::MVC::GetModel ( const char *  ModelName  ) 

Функция получения модели.

Аргументы:
ModelName - Имя модели.
Возвращает:
Модель.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 109

Перекрестные ссылки nitro::exception::code(), Models и nitro::exception::what().

Используется в LoadModules().

        {
                try
                {
                        return( Models[ ModelName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetModel( const char * ModelName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetModel( const char * ModelName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ModelInterface * nitro::MVC::GetModel ( const std::string &  ModelName  ) 

Функция получения модели.

Аргументы:
ModelName - Имя модели.
Возвращает:
Модель.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 157

Перекрестные ссылки nitro::exception::code(), Models и nitro::exception::what().

        {
                try
                {
                        return( Models[ ModelName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetModel( const char * ModelName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetModel( const std::string & ModelName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

const char * nitro::MVC::GetStartupControllerCommand ( void   )  const

Получение названия команды загрузочного контроллера.

Возвращает:
Название команды загрузочного контролера.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 469

Перекрестные ссылки nitro::exception::code(), StartupControllerCommand и nitro::exception::what().

        {
                try
                {
                        return( StartupControllerCommand.c_str() );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetStartupControllerCommand( void )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetStartupControllerCommand( void )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

const char * nitro::MVC::GetStartupControllerName ( void   )  const

Получение названия загрузочного контроллера.

Возвращает:
Название загрузочного контролера.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 453

Перекрестные ссылки nitro::exception::code(), StartupControllerName и nitro::exception::what().

        {
                try
                {
                        return( StartupControllerName.c_str() );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetStartupControllerName( void )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetStartupControllerName( void )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

const char * nitro::MVC::GetStartupViewName ( void   )  const

Получение названия загрузочного вида.

Возвращает:
Название загрузочного вида.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 437

Перекрестные ссылки nitro::exception::code(), StartupViewName и nitro::exception::what().

        {
                try
                {
                        return( StartupViewName.c_str() );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetStartupViewName( void )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetStartupViewName( void )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ViewInterface * nitro::MVC::GetView ( const std::string &  ViewName  ) 

Функция получения вида.

Аргументы:
ViewName - Имя вида.
Возвращает:
Вид.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 173

Перекрестные ссылки nitro::exception::code(), Views и nitro::exception::what().

        {
                try
                {
                        return( Views[ ViewName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetView( const std::string & ViewName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetView( const std::string & ViewName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

nitro::ViewInterface * nitro::MVC::GetView ( const char *  ViewName  ) 

Функция получения вида.

Аргументы:
ViewName - Имя вида.
Возвращает:
Вид.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 125

Перекрестные ссылки nitro::exception::code(), Views и nitro::exception::what().

Используется в LoadModules() и nitro::Application::OnInit().

        {
                try
                {
                        return( Views[ ViewName ] );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::GetView( const char * ViewName )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::GetView( const char * ViewName )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::LoadModule ( const char *  Path,
const nitro::XMLTag ManifestPart 
)

Функция загрузки модуля.

Аргументы:
Path - Путь по которому загружаем модуль.
ManifestPart - Часть манифеста.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Dodonov A.A.

См. определение в файле mvc_core.cpp строка 264

Перекрестные ссылки nitro::exception::code(), nitro::File::FileExists(), LoadModules() и nitro::exception::what().

Используется в Create().

        {
                try
                {
                        if( nitro::File::FileExists( Path ) == false )
                        {
                                throw( nitro::exception( std::string( "Module " ) + Path + " does not exists" , 1 ) );
                        }

                        std::vector< std::string >      ModulePaths;

                        ModulePaths.push_back( std::string( Path ) );

                        LoadModules( ModulePaths , ManifestPart );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::LoadModule( const char * Path , const nitro::XMLTag & ManifestPart )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::LoadModule( const char * Path , const nitro::XMLTag & ManifestPart )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::LoadModules ( const std::string &  Path,
const nitro::XMLTag ManifestPart 
)

Функция загрузки модулей.

Аргументы:
Path - Путь по которому загружаем библиотечки (либо путь к директории либо путь к конкретной библиотеке).
ManifestPart - Часть манифеста.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 289

Перекрестные ссылки nitro::exception::code(), LoadModules() и nitro::exception::what().

        {
                try
                {
                        LoadModules( Path.c_str() , ManifestPart );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::LoadModules( const std::string & Path , const nitro::XMLTag & ManifestPart )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::LoadModules( const std::string & Path , const nitro::XMLTag & ManifestPart )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::LoadModules ( const char *  Path,
const nitro::XMLTag ManifestPart 
)

Функция загрузки модулей.

Аргументы:
Path - Путь по которому загружаем библиотечки (либо путь к директории либо путь к конкретной библиотеке).
ManifestPart - Часть манифеста.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Dodonov A.A.

См. определение в файле mvc_core.cpp строка 237

Перекрестные ссылки nitro::exception::code(), nitro::CollectFilesFromDirectory() и nitro::exception::what().

Используется в Create(), LoadModule() и LoadModules().

        {
                try
                {
                        std::vector< std::string >      ModulePaths;

                        std::string                             PluginPath( "./bin/mvc/" );
                        if( Path != NULL && strlen( Path ) != 0 )
                        {
                                PluginPath = Path;
                        }
                        
                        // загрузка модулей
                        nitro::CollectFilesFromDirectory( PluginPath , ModulePaths );

                        LoadModules( ModulePaths , ManifestPart );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::LoadModules( const char * Path , const nitro::XMLTag & ManifestPart )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::LoadModules( const char * Path , const nitro::XMLTag & ManifestPart )::An error occured" , 1 ) );
                }
        }

Граф вызовов:

void nitro::MVC::LoadModules ( const std::vector< std::string > &  ModulePaths,
const nitro::XMLTag ManifestPart 
) [private]

Функция загрузки модулей.

Аргументы:
ModulePaths - Пути к загружаемым модулям.
ManifestPart - Кусок манифеста.
Исключения:
nitro::exception - В случае ошибки кидается исключение этого типа с описанием ошибки.
Автор:
Додонов А.А.

См. определение в файле mvc_core.cpp строка 495

Перекрестные ссылки AddController(), AddModel(), AddView(), nitro::exception::code(), DEFINE_DYNAMIC_ARRAY, nitro::Parsers::EndsWith(), GetController(), GetModel(), GetView(), nitro::DynamicLibManager::LoadLibrary(), Modules и nitro::exception::what().

        {
                try
                {
                        for( std::size_t i( 0 ) ; i < ModulePaths.size() ; i++ )
                        {
                                if( nitro::Parsers::EndsWith( ModulePaths[ i ] , std::string( ".dll" ) ) )
                                {
                                        Modules.LoadLibrary( ModulePaths[ i ] );

                                        if( Modules[ ModulePaths[ i ].c_str() ]->ResourceExists( "GetModel" ) )
                                        {
                                                DEFINE_DYNAMIC_ARRAY( char , Name , 128 );
                                                nitro::ModelInterface *                 Interface;

                                                void                                                    ( * GetModel )( char * , nitro::ModelInterface * & , const nitro::XMLTag & );
                                                GetModel = ( void ( * )( char * , nitro::ModelInterface * & , const nitro::XMLTag & ) )Modules[ ModulePaths[ i ].c_str() ]->GetResource( "GetModel" );

                                                GetModel( Name , Interface , ManifestPart );

                                                AddModel( Name , Interface );
                                        }

                                        if( Modules[ ModulePaths[ i ].c_str() ]->ResourceExists( "GetView" ) )
                                        {
                                                DEFINE_DYNAMIC_ARRAY( char , Name , 128 );
                                                nitro::ViewInterface *                  Interface;

                                                void                                                    ( * GetView )( char * , nitro::ViewInterface * & , const nitro::XMLTag & );
                                                GetView = ( void ( * )( char * , nitro::ViewInterface * & , const nitro::XMLTag & ) )Modules[ ModulePaths[ i ].c_str() ]->GetResource( "GetView" );

                                                GetView( Name , Interface , ManifestPart );

                                                AddView( Name , Interface );
                                        }

                                        if( Modules[ ModulePaths[ i ].c_str() ]->ResourceExists( "GetController" ) )
                                        {
                                                DEFINE_DYNAMIC_ARRAY( char , Name , 128 );
                                                nitro::ControllerInterface *    Interface;

                                                void                                                    ( * GetController )( char * , nitro::ControllerInterface * & , const nitro::XMLTag & );
                                                GetController = ( void ( * )( char * , nitro::ControllerInterface * & , const nitro::XMLTag & ) )Modules[ ModulePaths[ i ].c_str() ]->GetResource( "GetController" );

                                                GetController( Name , Interface , ManifestPart );

                                                AddController( Name , Interface );
                                        }
                                }
                        }
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "MVC::LoadModules( const std::vector< std::string > & ModulePaths , const nitro::XMLTag & ManifestPart )::" ) + e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "MVC::LoadModules( const std::vector< std::string > & ModulePaths , const nitro::XMLTag & ManifestPart )::An error occured" , 1 ) );
                }
        }

Граф вызовов:


Данные класса

Контроллеры.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 624

Используется в AddController(), ExecuteCommand() и GetController().

Модели.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 600

Используется в AddModel() и GetModel().

Загруженные модули.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 648

Используется в LoadModules().

MVC объекты.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 636

Используется в Create().

Корневой MVC.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 660

Используется в Create() и MVC().

std::string nitro::MVC::StartupControllerCommand [private]

Загрузочный контроллер.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 696

Используется в Create(), GetStartupControllerCommand() и MVC().

std::string nitro::MVC::StartupControllerName [private]

Загрузочный контроллер.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 684

Используется в Create(), GetStartupControllerName() и MVC().

std::string nitro::MVC::StartupViewName [private]

Загрузочный вид.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 672

Используется в Create(), GetStartupViewName() и MVC().

Виды.

Автор:
Додонов А.А.

См. определение в файле mvc_core.h строка 612

Используется в AddView(), ExecuteCommand() и GetView().


Объявления и описания членов классов находятся в файлах:

Generated by  doxygen 1.6.1