| 4968 | } |
| 4969 | |
| 4970 | void SourceModsContext::preload( const AttribSet &requestedAttribs ) |
| 4971 | { |
| 4972 | if( ! mSource ) { |
| 4973 | CI_LOG_E( "SourceModsContext::preload() called with a NULL source." ); |
| 4974 | return; |
| 4975 | } |
| 4976 | |
| 4977 | // If we have modifiers, initiate the chain by calling the last modifier's process() method. |
| 4978 | // This in turn will call processUpstream(), which will call the next modifier's process(), until there |
| 4979 | // are no remaining modifiers. Finally processUpstream() will call loadInto() on the Source |
| 4980 | if( ! mModiferStack.empty() ) { |
| 4981 | auto modifier = mModiferStack.back(); |
| 4982 | mModiferStack.pop_back(); |
| 4983 | modifier->process( this, requestedAttribs ); |
| 4984 | } |
| 4985 | else { // no modifiers; just loadInto on the soucre directly |
| 4986 | mSource->loadInto( this, requestedAttribs ); |
| 4987 | } |
| 4988 | } |
| 4989 | |
| 4990 | // Expects preload() to have been called on 'rhs' |
| 4991 | void SourceModsContext::combine( const SourceModsContext &rhs ) |