examples/resources/libexamplefilesystem.cpp
// =-=-=-=-=-=-=-
// 4. create the plugin factory function which will return a dynamically
//    instantiated object of the previously defined derived resource.  use
//    the add_operation member to associate a 'call name' to the interfaces
//    defined above.  for resource plugins these call names are standardized
//    as used by the irods facing interface defined in
//    server/drivers/src/fileDriver.c
4. create the plugin factory function which will return a dynamically
instantiated object of the previously defined derived resource.  use
the add_operation member to associate a 'call name' to the interfaces
defined above.  for resource plugins these call names are standardized
as used by the irods facing interface defined in
server/drivers/src/fileDriver.c
4 . create the plugin factory function which will return a dynamically instantiated object of the previously defined derived resource . use the add_operation member to associate a ' call name ' to the interfaces defined above . for resource plugins these call names are standardized as used by the irods facing interface defined in server / drivers / src / fileDriver . c
irods::resource* plugin_factory( const std::string& _inst_name, const std::string& _context ) {
        examplefilesystem_resource* resc = new examplefilesystem_resource( _inst_name, _context );
        resc->add_operation( irods::RESOURCE_OP_CREATE,       "example_file_create_plugin" );
        resc->add_operation( irods::RESOURCE_OP_OPEN,         "example_file_open_plugin" );
        resc->add_operation( irods::RESOURCE_OP_READ,         "example_file_read_plugin" );
        resc->add_operation( irods::RESOURCE_OP_WRITE,        "example_file_write_plugin" );
        resc->add_operation( irods::RESOURCE_OP_CLOSE,        "example_file_close_plugin" );
        resc->add_operation( irods::RESOURCE_OP_UNLINK,       "example_file_unlink_plugin" );
        resc->add_operation( irods::RESOURCE_OP_STAT,         "example_file_stat_plugin" );
        resc->add_operation( irods::RESOURCE_OP_LSEEK,        "example_file_lseek_plugin" );
        resc->add_operation( irods::RESOURCE_OP_MKDIR,        "example_file_mkdir_plugin" );
        resc->add_operation( irods::RESOURCE_OP_RMDIR,        "example_file_rmdir_plugin" );
        resc->add_operation( irods::RESOURCE_OP_OPENDIR,      "example_file_opendir_plugin" );
        resc->add_operation( irods::RESOURCE_OP_CLOSEDIR,     "example_file_closedir_plugin" );
        resc->add_operation( irods::RESOURCE_OP_READDIR,      "example_file_readdir_plugin" );
        resc->add_operation( irods::RESOURCE_OP_RENAME,       "example_file_rename_plugin" );
        resc->add_operation( irods::RESOURCE_OP_TRUNCATE,     "example_file_truncate_plugin" );
        resc->add_operation( irods::RESOURCE_OP_FREESPACE,    "example_file_get_fsfreespace_plugin" );
        resc->add_operation( irods::RESOURCE_OP_STAGETOCACHE, "example_file_stagetocache_plugin" );
        resc->add_operation( irods::RESOURCE_OP_SYNCTOARCH,   "example_file_synctoarch_plugin" );
        resc->add_operation( irods::RESOURCE_OP_REGISTERED,   "example_file_registered_plugin" );
        resc->add_operation( irods::RESOURCE_OP_UNREGISTERED, "example_file_unregistered_plugin" );
        resc->add_operation( irods::RESOURCE_OP_MODIFIED,     "example_file_modified_plugin" );
        resc->add_operation( irods::RESOURCE_OP_NOTIFY,       "example_file_notify_plugin" );
        resc->add_operation( irods::RESOURCE_OP_RESOLVE_RESC_HIER,     "example_file_redirect_plugin" );
        resc->add_operation( irods::RESOURCE_OP_REBALANCE,             "example_file_rebalance" );
        resc->set_property< int >( irods::RESOURCE_CHECK_PATH_PERM, 2 );
        resc->set_property< int >( irods::RESOURCE_CREATE_PATH,     1 );
        return dynamic_cast<irods::resource*>( resc );
    }
irods :: resource * plugin_factory ( const std :: string & _inst_name , const std :: string & _context ) { examplefilesystem_resource * resc = new examplefilesystem_resource ( _inst_name , _context ) ; resc -> add_operation ( irods :: RESOURCE_OP_CREATE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_OPEN , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_READ , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_WRITE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_CLOSE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_UNLINK , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_STAT , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_LSEEK , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_MKDIR , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_RMDIR , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_OPENDIR , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_CLOSEDIR , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_READDIR , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_RENAME , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_TRUNCATE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_FREESPACE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_STAGETOCACHE , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_SYNCTOARCH , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_REGISTERED , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_UNREGISTERED , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_MODIFIED , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_NOTIFY , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_RESOLVE_RESC_HIER , " " ) ; resc -> add_operation ( irods :: RESOURCE_OP_REBALANCE , " " ) ; resc -> set_property < int > ( irods :: RESOURCE_CHECK_PATH_PERM , 2 ) ; resc -> set_property < int > ( irods :: RESOURCE_CREATE_PATH , 1 ) ; return dynamic_cast < irods :: resource * > ( resc ) ; }
4. create the plugin factory function which will return a dynamically
instantiated object of the previously defined derived resource.
4 . create the plugin factory function which will return a dynamically instantiated object of the previously defined derived resource .
// =-=-=-=-=-=-=- // 4a. create examplefilesystem_resource // =-=-=-=-=-=-=- // 4b. map function names to operations.  this map will be used to load //     the symbols from the shared object in the delay_load stage of //     plugin loading. // =-=-=-=-=-=-=- // set some properties necessary for backporting to iRODS legacy code //DO_CHK_PATH_PERM ); //CREATE_PATH ); // =-=-=-=-=-=-=- // 4c. return the pointer through the generic interface of an //     irods::resource pointer