bbtk::ComplexBlackBoxDescriptor Class Reference

Describes a ComplexBlackBox (constituents, connections) and is able to create an instance of it. More...

#include <bbtkComplexBlackBoxDescriptor.h>

Inheritance diagram for bbtk::ComplexBlackBoxDescriptor:

Inheritance graph
[legend]
Collaboration diagram for bbtk::ComplexBlackBoxDescriptor:

Collaboration graph
[legend]

List of all members.

Public Types

typedef ComplexBlackBoxDescriptor Self
typedef boost::shared_ptr< SelfPointer
typedef boost::weak_ptr< SelfWeakPointer
enum  Kind {
  STANDARD = 0, ADAPTOR = 1, DEFAULT_ADAPTOR = 2, GUI = 3,
  DEFAULT_GUI = 4
}
 The kinds of black box. More...
typedef BlackBoxInputDescriptor InputDescriptor
 The type of descriptor of inputs.
typedef BlackBoxOutputDescriptor OutputDescriptor
 The type of descriptor of outputs.
typedef std::map< std::string,
InputDescriptor * > 
InputDescriptorMapType
 The type of dictionnary of inputs = map of input descriptors pointers.
typedef std::map< std::string,
OutputDescriptor * > 
OutputDescriptorMapType
 The type of dictionnary of outputs= map of output descriptors pointers.

Public Member Functions

std::string GetObjectName () const
std::string GetObjectInfo () const
size_t GetObjectSize () const
size_t GetObjectInternalSize () const
size_t GetObjectRecursiveSize () const
void SetFactory (Factory::Pointer f)
 Sets the factory used.
Factory::Pointer GetFactory () const
 Gets the factory used.
virtual BlackBoxPointer NewBlackBox (const std::string &name)
 Releases the descriptor.
void Add (const std::string &type, const std::string &name)
 Adds a black box to the complex box.
void Remove (const std::string &name, bool remove_connections=true)
 Removes a black box from the complex box.
void Connect (const std::string &from, const std::string &output, const std::string &to, const std::string &input)
 Connects two black boxes of the complex box.
void DefineInput (const std::string &name, const std::string &box, const std::string &input, const std::string &help)
 Defines an input of the complex box.
void DefineOutput (const std::string &name, const std::string &box, const std::string &output, const std::string &help)
 Defines an output of the complex box.
void SetScriptFileName (const std::string &n)
 Sets the name of the script file from which it is defined.
std::string GetScriptFileName () const
 Gets the name of the script file from which it is defined.
void AddToExecutionList (const std::string &box)
 Adds a black box to the execution list.
ComplexBlackBoxPointer GetPrototype ()
void PrintBlackBoxes ()
void GetHelp (bool full=true) const
 Prints help on the black box.
void InsertHtmlHelp (std::ofstream &s, int detail, int level, const std::string &output_dir="", bool relative_link=false)
void InsertHTMLGraph (std::ofstream &s, int detail, int level, const std::string &output_dir="", bool relative_link=false)
virtual void Check (bool recursive=true) const
 Check.
const std::string & GetTypeName () const
 Returns the name of the **TYPE** of the black box.
std::string GetFullTypeName () const
 Returns the full name of the **TYPE** of the black box (+package name).
const std::string & GetDescription () const
 Returns the description of the BlackBox.
const std::string & GetAuthor () const
 Returns the author(s) of the BlackBox.
const std::string & GetCategory () const
 Returns the category(s) of the BlackBox.
PackagePointer GetPackage () const
 Returns the Package to which the box belongs (const pointer).
Kind GetKind () const
 Returns the kind of box.
const InputDescriptorMapTypeGetInputDescriptorMap () const
 Returns a const ref on the map of input descriptors.
const OutputDescriptorMapTypeGetOutputDescriptorMap () const
 Returns a const ref on the map of output descriptors.
const InputDescriptorGetInputDescriptor (const std::string &name) const
 Returns a const pointer on the descriptor of the input of name <name>.
const OutputDescriptorGetOutputDescriptor (const std::string &name) const
 Returns a const pointer on the descriptor of the output of name <name>.
void SetTypeName (const std::string &name)
 Sets the name of the **TYPE** of BlackBox.
void AddToDescription (const std::string &, bool clear=false)
 Adds the string to the BlackBox description.
void AddToAuthor (const std::string &, bool clear=false)
 Adds the string to the BlackBox author list.
void AddToCategory (const std::string &, bool clear=false)
 Adds the string to the BlackBox category list.
void SetPackage (PackagePointer package)
 Sets the Package to which the box belongs.
void SetKind (Kind kind)
 Sets the kind of box.
long GetUseCount ()

Static Public Member Functions

static Pointer New (const std::string &name)
static void InsertInObjectList (Pointer)
static void RemoveFromObjectList (WeakPointer)
static void InsertInPackageList (Pointer)
static void ReleasePackages ()
static void PrintObjectListInfo (const std::string &name)
static void PrintObjectInfo (const Pointer &o)
static long GetObjectsCount ()

Protected Types

typedef BlackBoxDescriptor Superclass

Protected Member Functions

 ComplexBlackBoxDescriptor ()
 ComplexBlackBoxDescriptor (const ComplexBlackBoxDescriptor &)
 ~ComplexBlackBoxDescriptor ()
 Default dtor.
 ComplexBlackBoxDescriptor (const std::string &name)
 Default ctor with name is protected.
void AddInputDescriptor (BlackBoxInputDescriptor *d)
 Adds an input descriptor.
void AddOutputDescriptor (BlackBoxOutputDescriptor *d)
 Adds an output descriptor.
void LockThis ()
void UnLockThis ()
template<class U >
boost::shared_ptr< U > GetThisPointer () const

Static Protected Member Functions

template<class U >
static boost::shared_ptr< U > MakePointer (U *s, bool lock=false)
template<class U , class D >
static boost::shared_ptr< U > MakePointer (U *s, const D &del, bool lock=false)

Protected Attributes

std::string mTypeName
 The name of the type of black box.
std::string mDescription
 The description of the black box.
std::string mAuthor
 The author of the black box.
std::string mCategory
 The category of the black box.
Kind mKind
 The kind of box (standard / adaptor).
PackagePointer mPackage
 The Package to which the box belongs.
InputDescriptorMapType mInput
 The inputs.
OutputDescriptorMapType mOutput
 The outputs.

Private Attributes

Factory::WeakPointer mFactory
 The factory used.
ComplexBlackBoxPointer mPrototype
 The complex box in which boxes and connections are stored.
std::string mScriptFileName
 The name of the script file from which it was created.

Friends

struct Object::Deleter
class ComplexBlackBox


Detailed Description

Describes a ComplexBlackBox (constituents, connections) and is able to create an instance of it.

Definition at line 57 of file bbtkComplexBlackBoxDescriptor.h.


Member Typedef Documentation

The type of descriptor of inputs.

Definition at line 61 of file bbtkBlackBoxDescriptor.h.

typedef std::map<std::string, InputDescriptor*> bbtk::BlackBoxDescriptor::InputDescriptorMapType [inherited]

The type of dictionnary of inputs = map of input descriptors pointers.

Definition at line 68 of file bbtkBlackBoxDescriptor.h.

The type of descriptor of outputs.

Definition at line 66 of file bbtkBlackBoxDescriptor.h.

typedef std::map<std::string, OutputDescriptor*> bbtk::BlackBoxDescriptor::OutputDescriptorMapType [inherited]

The type of dictionnary of outputs= map of output descriptors pointers.

Definition at line 70 of file bbtkBlackBoxDescriptor.h.

typedef boost::shared_ptr<Self> bbtk::ComplexBlackBoxDescriptor::Pointer

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 60 of file bbtkComplexBlackBoxDescriptor.h.

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 60 of file bbtkComplexBlackBoxDescriptor.h.

Definition at line 60 of file bbtkComplexBlackBoxDescriptor.h.

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 60 of file bbtkComplexBlackBoxDescriptor.h.


Member Enumeration Documentation

The kinds of black box.

Enumerator:
STANDARD 
ADAPTOR 
DEFAULT_ADAPTOR 
GUI 
DEFAULT_GUI 

Definition at line 72 of file bbtkBlackBoxDescriptor.h.

00073     {
00074       STANDARD=0,
00075       ADAPTOR=1,
00076       DEFAULT_ADAPTOR=2,
00077       GUI=3,
00078       DEFAULT_GUI=4
00079     }


Constructor & Destructor Documentation

bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor (  )  [protected]

Referenced by New().

Here is the caller graph for this function:

bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor ( const ComplexBlackBoxDescriptor  )  [protected]

bbtk::ComplexBlackBoxDescriptor::~ComplexBlackBoxDescriptor (  )  [protected]

Default dtor.

Definition at line 80 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and mPrototype.

00081   {
00082     bbtkDDebugMessage("object",2,"==> ~ComplexBlackBoxDescriptor()"<<std::endl);
00083     mPrototype.reset();
00084     bbtkDDebugMessage("object",2,"<== ~ComplexBlackBoxDescriptor()"<<std::endl);
00085   }

bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor ( const std::string &  name  )  [protected]

Default ctor with name is protected.

Default ctor.

Definition at line 64 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::AddToCategory(), bbtkDDebugMessage, bbtk::Object::MakePointer(), mPrototype, New(), and bbtk::BlackBoxDescriptor::SetTypeName().

00065   {
00066     bbtkDDebugMessage("object",2,"==> ComplexBlackBoxDescriptor(\""<<name<<"\")"<<std::endl);
00067     SetTypeName(name);
00068     AddToCategory("complex box");
00069     mPrototype = ComplexBlackBox::New(name+std::string("Prototype"),
00070                                       MakePointer(this,true));
00071     mPrototype->SetAsPrototype();
00072     bbtkDDebugMessage("object",2,"<== ComplexBlackBoxDescriptor(\""<<name<<"\")"<<std::endl);
00073   }

Here is the call graph for this function:


Member Function Documentation

void bbtk::ComplexBlackBoxDescriptor::Add ( const std::string &  type,
const std::string &  name 
)

Adds a black box to the complex box.

Adds a black box to the complex box Needs a factory set !

Definition at line 123 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, GetFactory(), mPrototype, and NewBlackBox().

00126   {
00127     bbtkDDebugMessage("kernel",5,
00128                         "ComplexBlackBoxDescriptor::Add(\""
00129                         <<type<<"\",\""<<name<<"\")"
00130                         <<std::endl);
00131     
00132     // 
00133     if (!GetFactory()) 
00134       { 
00135         bbtkError("ComplexBlackBoxDescriptor::Add : no factory set");
00136       }
00137     
00138     // Verify that a box with the same name does not exist already
00139     if ( mPrototype->bbUnsafeGetBlackBox( name ) ) 
00140       {
00141         bbtkError("a black box \""<<name<<"\" already exists");
00142       }
00143     // ok : create new one
00144     mPrototype->bbAddBlackBox ( GetFactory()->NewBlackBox(type,name) );
00145 
00146 
00147   }

Here is the call graph for this function:

void bbtk::BlackBoxDescriptor::AddInputDescriptor ( BlackBoxInputDescriptor d  )  [inline, protected, inherited]

Adds an input descriptor.

Definition at line 163 of file bbtkBlackBoxDescriptor.h.

References bbtk::BlackBoxInputOutputDescriptor::GetName().

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and DefineInput().

00164     { mInput[d->GetName()] = d; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddOutputDescriptor ( BlackBoxOutputDescriptor d  )  [inline, protected, inherited]

Adds an output descriptor.

Definition at line 166 of file bbtkBlackBoxDescriptor.h.

References bbtk::BlackBoxInputOutputDescriptor::GetName().

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and DefineOutput().

00167     { mOutput[d->GetName()] = d; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddToAuthor ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox author list.

Definition at line 162 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mAuthor.

00163   {
00164     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToAuthor(\""
00165                       <<s<<"\")"
00166                       <<std::endl);
00167     if (clear) mAuthor = s;
00168     else mAuthor += s;
00169   }

void bbtk::BlackBoxDescriptor::AddToCategory ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox category list.

Definition at line 174 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mCategory.

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and ComplexBlackBoxDescriptor().

00175   {
00176     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToCategory(\""
00177                       <<s<<"\")"
00178                       <<std::endl);  
00179     if (clear) mCategory = s;
00180     else mCategory += s;
00181     mCategory += ";";
00182   }  

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddToDescription ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox description.

Definition at line 151 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mDescription.

00152   {
00153     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToDescription(\""
00154                       <<s<<"\")"<<std::endl);
00155     if (clear) mDescription = s; 
00156     else mDescription += s;
00157    }

void bbtk::ComplexBlackBoxDescriptor::AddToExecutionList ( const std::string &  box  ) 

Adds a black box to the execution list.

Definition at line 162 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, and mPrototype.

00163   {
00164     bbtkDDebugMessage("kernel",5,
00165                       "ComplexBlackBoxDescriptor::AddToExecutionList(\""
00166                       <<box<<"\""
00167                       <<std::endl);
00168     // Verify that the box exists
00169     BlackBox::Pointer b = mPrototype->bbUnsafeGetBlackBox( box ); 
00170     if ( !b ) 
00171       {
00172         bbtkError("the black box \""<<box<<"\" does not exist");
00173       }
00174     // ok 
00175     mPrototype->bbAddToExecutionList ( box  );
00176 
00177 
00178     }

void bbtk::ComplexBlackBoxDescriptor::Check ( bool  recursive = true  )  const [virtual]

Check.

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 90 of file bbtkComplexBlackBoxDescriptor.cxx.

References mPrototype.

00091   {
00092     mPrototype->Check(recursive);
00093   }

void bbtk::ComplexBlackBoxDescriptor::Connect ( const std::string &  from,
const std::string &  output,
const std::string &  to,
const std::string &  input 
)

Connects two black boxes of the complex box.

Connects two black boxes of the complex box Needs a factory set !

Definition at line 183 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, GetFactory(), and mPrototype.

00188   {
00189     bbtkDDebugMessage("kernel",5,
00190                         "ComplexBlackBoxDescriptor::Connect(\""
00191                         <<from<<"\",\""<<output<<"\",\""
00192                         <<to<<"\",\""<<input
00193                         <<"\")"
00194                         <<std::endl);
00195   // 
00196     if (!GetFactory()) 
00197       { 
00198         bbtkError("ComplexBlackBoxDescriptor::Connect : no factory set");
00199       }
00200     
00201 
00202   // Verify that a box with the same name does not exist already
00203     BlackBox::Pointer bbfrom = mPrototype->bbGetBlackBox( from );
00204     if ( !bbfrom ) 
00205       {
00206         bbtkError("the black box \""<<from<<"\" does not exist");
00207       }
00208     BlackBox::Pointer bbto = mPrototype->bbGetBlackBox( to );
00209     if ( !bbto ) 
00210       {
00211         bbtkError("the black box \""<<to<<"\" does not exist");
00212       }
00213     
00214     Connection::Pointer c 
00215       = GetFactory()->NewConnection( bbfrom, output, bbto, input );
00216 
00217     mPrototype->bbAddConnection(c);
00218 
00219 
00220   }

Here is the call graph for this function:

void bbtk::ComplexBlackBoxDescriptor::DefineInput ( const std::string &  name,
const std::string &  box,
const std::string &  input,
const std::string &  help 
)

Defines an input of the complex box.

Definition at line 226 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::AddInputDescriptor(), bbtkDDebugMessage, bbtkError, bbtk::BlackBoxInputOutputDescriptor::GetNature(), bbtk::BlackBoxInputOutputDescriptor::GetTypeInfo(), and mPrototype.

00230   {
00231     bbtkDDebugMessage("kernel",5,
00232                         "ComplexBlackBoxDescriptor::DefineInput(\""
00233                         <<name<<"\",\""<<box<<"\",\""
00234                         <<input<<"\",\""<<help
00235                         <<"\")"
00236                         <<std::endl);
00237 
00238     BlackBox::Pointer bb = mPrototype->bbGetBlackBox( box );
00239     if ( !bb ) 
00240       {
00241         bbtkError("the black box \""<<box<<"\" does not exist");
00242       }
00243 
00244     if (!bb->bbHasInput(input) )
00245       {
00246         bbtkError("the black box \""<<box<<"\" does not have input \""
00247                   <<input<<"\"");
00248       }
00249     
00250     const BlackBoxInputDescriptor* d = 
00251       bb->bbGetDescriptor()->GetInputDescriptor(input);
00252     AddInputDescriptor ( new ComplexBlackBoxInputDescriptor 
00253                          ( typeid(ComplexBlackBoxDescriptor),
00254                            name,
00255                            help,
00256                            d->GetNature(),
00257                            box,
00258                            input,
00259                            d->GetTypeInfo()));
00260     
00261     
00262 
00263   }

Here is the call graph for this function:

void bbtk::ComplexBlackBoxDescriptor::DefineOutput ( const std::string &  name,
const std::string &  box,
const std::string &  output,
const std::string &  help 
)

Defines an output of the complex box.

Definition at line 268 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::AddOutputDescriptor(), bbtkDDebugMessage, bbtkError, bbtk::BlackBoxInputOutputDescriptor::GetNature(), bbtk::BlackBoxInputOutputDescriptor::GetTypeInfo(), and mPrototype.

00272   {
00273     bbtkDDebugMessage("kernel",5,
00274                         "ComplexBlackBoxDescriptor::DefineOutput(\""
00275                         <<name<<"\",\""<<box<<"\",\""
00276                         <<output<<"\",\""<<help
00277                         <<"\")"
00278                         <<std::endl);
00279 
00280     BlackBox::Pointer bb = mPrototype->bbGetBlackBox( box );
00281     if ( !bb ) 
00282       {
00283         bbtkError("the black box \""<<box<<"\" does not exist");
00284       }
00285 
00286     if (!bb->bbHasOutput(output) )
00287       {
00288         bbtkError("the black box \""<<box<<"\" does not have output \""
00289                   <<output<<"\"");
00290       }
00291     
00292     const BlackBoxOutputDescriptor* d = 
00293       bb->bbGetDescriptor()->GetOutputDescriptor(output);
00294     AddOutputDescriptor ( new ComplexBlackBoxOutputDescriptor 
00295                           ( typeid(ComplexBlackBoxDescriptor),
00296                             name,
00297                             help,
00298                             d->GetNature(),
00299                             box,
00300                             output,
00301                             d->GetTypeInfo()));
00302     
00303     
00304 
00305   }

Here is the call graph for this function:

const std::string& bbtk::BlackBoxDescriptor::GetAuthor (  )  const [inline, inherited]

Returns the author(s) of the BlackBox.

Definition at line 99 of file bbtkBlackBoxDescriptor.h.

Referenced by GetHelp(), bbtk::BlackBoxDescriptor::GetHelp(), InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00099 { return mAuthor; }

Here is the caller graph for this function:

const std::string& bbtk::BlackBoxDescriptor::GetCategory (  )  const [inline, inherited]

Returns the category(s) of the BlackBox.

Definition at line 102 of file bbtkBlackBoxDescriptor.h.

Referenced by GetHelp(), bbtk::BlackBoxDescriptor::GetHelp(), InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00102 { return mCategory; }

Here is the caller graph for this function:

const std::string& bbtk::BlackBoxDescriptor::GetDescription (  )  const [inline, inherited]

Returns the description of the BlackBox.

Definition at line 96 of file bbtkBlackBoxDescriptor.h.

Referenced by GetHelp(), bbtk::BlackBoxDescriptor::GetHelp(), InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00096 { return mDescription; }

Here is the caller graph for this function:

Factory::Pointer bbtk::ComplexBlackBoxDescriptor::GetFactory (  )  const [inline]

Gets the factory used.

Definition at line 69 of file bbtkComplexBlackBoxDescriptor.h.

Referenced by Add(), and Connect().

00069 { return mFactory.lock(); }

Here is the caller graph for this function:

std::string bbtk::BlackBoxDescriptor::GetFullTypeName (  )  const [inherited]

Returns the full name of the **TYPE** of the black box (+package name).

Definition at line 304 of file bbtkBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::GetPackage(), and bbtk::BlackBoxDescriptor::mTypeName.

Referenced by bbtk::BlackBoxDescriptor::GetHelp(), GetObjectName(), and bbtk::WxGUIBlackBoxList::OnBeginDrag().

00305   {
00306     if (GetPackage()!=0) return GetPackage()->GetName() + "::" + mTypeName;
00307     return "::" + mTypeName;
00308   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::ComplexBlackBoxDescriptor::GetHelp ( bool  full = true  )  const [virtual]

Prints help on the black box.

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 519 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkMessage, bbtk::BlackBoxDescriptor::GetAuthor(), bbtk::BlackBoxDescriptor::GetCategory(), bbtk::BlackBoxDescriptor::GetDescription(), bbtk::BlackBoxDescriptor::GetPackage(), bbtk::BlackBoxDescriptor::GetTypeName(), bbtk::i, bbtk::BlackBoxDescriptor::mInput, bbtk::BlackBoxDescriptor::mOutput, and mPrototype.

00520   {
00521     if (full) bbtkMessage("help",1,"Complex Black Box <"<<
00522                           GetPackage()->GetName()<<"::"
00523                           <<GetTypeName()<<">"<<std::endl);
00524     bbtkMessage("help",1," "                << GetDescription() <<std::endl);
00525     bbtkMessage("help",1," By : "           << GetAuthor()      <<std::endl);
00526     bbtkMessage("help",1," Category(s) : "  << GetCategory()     <<std::endl);    
00527     if (mInput.size()) 
00528       bbtkMessage("help",1," * Inputs : "<<std::endl);
00529     else 
00530       bbtkMessage("help",1," * No inputs"<<std::endl);
00531     InputDescriptorMapType::const_iterator i;
00532     unsigned int namelmax = 0;
00533     unsigned int typelmax = 0;
00534     unsigned int natlmax = 0;
00535     for ( i = mInput.begin();  i != mInput.end(); ++i ) 
00536     {
00537            if (i->second->GetName().size()>namelmax) 
00538              namelmax = i->second->GetName().size();
00539            if (i->second->GetTypeName().size()>typelmax) 
00540              typelmax = i->second->GetTypeName().size();
00541            if (i->second->GetNature().size()>natlmax) 
00542              natlmax = i->second->GetNature().size();
00543     }
00544     OutputDescriptorMapType::const_iterator o;
00545     if (full) 
00546     {
00547            for ( o = mOutput.begin();  o != mOutput.end(); ++o ) 
00548            {
00549              if (o->second->GetName().size()>namelmax) 
00550                namelmax = o->second->GetName().size();
00551             if (o->second->GetTypeName().size()>typelmax) 
00552                typelmax = o->second->GetTypeName().size();
00553            if (o->second->GetNature().size()>natlmax) 
00554              natlmax = o->second->GetNature().size();
00555            }
00556     }
00557     //
00558 
00559     for ( i = mInput.begin();  i != mInput.end(); ++i ) 
00560     {
00561            std::string name(i->second->GetName());
00562            name += "'";
00563            name.append(1+namelmax-name.size(),' ');
00564            std::string type(i->second->GetTypeName());
00565            type += ">";
00566            type.append(1+typelmax-type.size(),' ');
00567            std::string nature(i->second->GetNature());
00568            nature += "]";
00569            nature.append(1+natlmax-nature.size(),' ');
00570            bbtkMessage("help",1,
00571                        "    '"<<name
00572                        <<" <"<<type
00573                        <<" ["<<nature
00574                        <<" : "<<i->second->GetDescription()<<std::endl);
00575     }
00576     if (full) 
00577     {
00578            if (mOutput.size()) 
00579              bbtkMessage("help",1," * Outputs : "<<std::endl);
00580            else 
00581              bbtkMessage("help",1," * No outputs"<<std::endl);
00582            for ( o = mOutput.begin();  o != mOutput.end(); ++o ) 
00583            {
00584              std::string name(o->second->GetName());
00585              name += "'";
00586              name.append(1+namelmax-name.size(),' ');
00587              std::string type(o->second->GetTypeName());
00588              type += ">";
00589              type.append(1+typelmax-type.size(),' ');
00590              std::string nature(o->second->GetNature());
00591              nature += "]";
00592              nature.append(1+natlmax-nature.size(),' ');
00593              bbtkMessage("help",1,
00594                        "    '"<<name
00595                          <<" <"<<type
00596                          <<" ["<<nature
00597                          <<" : "<<o->second->GetDescription()<<std::endl);
00598            }
00599     }
00600     if (full) 
00601     {
00602            const ComplexBlackBox::BlackBoxMapType& B = mPrototype->bbGetBlackBoxMap();
00603         
00604            if (B.size()) 
00605              bbtkMessage("help",1," * Boxes : "<<std::endl);
00606            else 
00607              bbtkMessage("help",1," * No boxes"<<std::endl);
00608         
00609            ComplexBlackBox::BlackBoxMapType::const_iterator b;
00610            for ( b = B.begin(); b != B.end(); ++b ) 
00611            {
00612              bbtkMessage("help",1,"    '"<<b->second->bbGetName()<<
00613                          "' <"
00614                          << b->second->bbGetDescriptor()->GetPackage()->GetName() 
00615                          <<"::"
00616                          <<b->second->bbGetTypeName()<<">"<<std::endl);
00617            }
00618     }
00619 
00620   }   

Here is the call graph for this function:

const BlackBoxDescriptor::InputDescriptor * bbtk::BlackBoxDescriptor::GetInputDescriptor ( const std::string &  name  )  const [inherited]

Returns a const pointer on the descriptor of the input of name <name>.

Definition at line 187 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, bbtk::i, and bbtk::BlackBoxDescriptor::mInput.

00188   {
00189     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetInputDescriptor('"
00190                       <<name<<"')"<<std::endl);
00191 
00192     InputDescriptorMapType::const_iterator i;
00193     i = mInput.find(name);
00194     if ( i == mInput.end() ) 
00195     {
00196             bbtkError("input '"<<name<<"' does not exist");
00197     }
00198 
00199     return i->second;
00200   }

const InputDescriptorMapType& bbtk::BlackBoxDescriptor::GetInputDescriptorMap (  )  const [inline, inherited]

Returns a const ref on the map of input descriptors.

Definition at line 114 of file bbtkBlackBoxDescriptor.h.

Referenced by InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00115       { return mInput; }

Here is the caller graph for this function:

Kind bbtk::BlackBoxDescriptor::GetKind (  )  const [inline, inherited]

Returns the kind of box.

Definition at line 108 of file bbtkBlackBoxDescriptor.h.

00108 { return mKind; }

std::string bbtk::ComplexBlackBoxDescriptor::GetObjectInfo (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 631 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtk::i.

00632   {
00633     std::string i;
00634     return i;     
00635   }

size_t bbtk::ComplexBlackBoxDescriptor::GetObjectInternalSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 646 of file bbtkComplexBlackBoxDescriptor.cxx.

Referenced by GetObjectRecursiveSize(), and GetObjectSize().

00647 {
00648   size_t s = sizeof(ComplexBlackBoxDescriptor);
00649   return s;
00650   }

Here is the caller graph for this function:

std::string bbtk::ComplexBlackBoxDescriptor::GetObjectName (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 624 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::GetFullTypeName().

00625   {
00626     return std::string("ComplexBlackBoxDescriptor '")+GetFullTypeName()
00627       +std::string("'");
00628   }

Here is the call graph for this function:

size_t bbtk::ComplexBlackBoxDescriptor::GetObjectRecursiveSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 653 of file bbtkComplexBlackBoxDescriptor.cxx.

References GetObjectInternalSize(), bbtk::Object::GetObjectRecursiveSize(), and mPrototype.

00654   {
00655     size_t s = Superclass::GetObjectRecursiveSize();
00656     s += ComplexBlackBoxDescriptor::GetObjectInternalSize();
00657     s += mPrototype->GetObjectRecursiveSize();
00658     return s;
00659   }

Here is the call graph for this function:

static long bbtk::Object::GetObjectsCount (  )  [inline, static, inherited]

Definition at line 75 of file bbtkObject.h.

Referenced by bbtk::StaticInitTime::~StaticInitTime().

00075 { return mgObjectList.size(); }

Here is the caller graph for this function:

size_t bbtk::ComplexBlackBoxDescriptor::GetObjectSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 638 of file bbtkComplexBlackBoxDescriptor.cxx.

References GetObjectInternalSize(), and bbtk::Object::GetObjectSize().

00639 {
00640   size_t s = Superclass::GetObjectSize();
00641   s += ComplexBlackBoxDescriptor::GetObjectInternalSize();
00642   return s;
00643   }

Here is the call graph for this function:

const BlackBoxDescriptor::OutputDescriptor * bbtk::BlackBoxDescriptor::GetOutputDescriptor ( const std::string &  name  )  const [inherited]

Returns a const pointer on the descriptor of the output of name <name>.

Definition at line 205 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, bbtk::i, and bbtk::BlackBoxDescriptor::mOutput.

00206   {
00207     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetOutputDescriptor('"
00208                       <<name<<"')"<<std::endl);
00209 
00210     OutputDescriptorMapType::const_iterator i;
00211     i = mOutput.find(name);
00212     if ( i == mOutput.end() ) 
00213     {
00214       bbtkError("output '"<<name<<"' does not exist");
00215     }
00216 
00217     return i->second;
00218   }

const OutputDescriptorMapType& bbtk::BlackBoxDescriptor::GetOutputDescriptorMap (  )  const [inline, inherited]

Returns a const ref on the map of output descriptors.

Definition at line 118 of file bbtkBlackBoxDescriptor.h.

Referenced by InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00119       { return mOutput; }

Here is the caller graph for this function:

PackagePointer bbtk::BlackBoxDescriptor::GetPackage (  )  const [inline, inherited]

Returns the Package to which the box belongs (const pointer).

Definition at line 105 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::GetFullTypeName(), GetHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected().

00105 { return mPackage; }

Here is the caller graph for this function:

ComplexBlackBoxPointer bbtk::ComplexBlackBoxDescriptor::GetPrototype (  )  [inline]

Definition at line 116 of file bbtkComplexBlackBoxDescriptor.h.

00116 { return mPrototype; }

std::string bbtk::ComplexBlackBoxDescriptor::GetScriptFileName (  )  const [inline]

Gets the name of the script file from which it is defined.

Definition at line 111 of file bbtkComplexBlackBoxDescriptor.h.

Referenced by InsertHtmlHelp().

00111 { return mScriptFileName; }

Here is the caller graph for this function:

template<class U >
boost::shared_ptr<U> bbtk::Object::GetThisPointer (  )  const [inline, protected, inherited]

Definition at line 92 of file bbtkObject.h.

00093     {
00094       return boost::dynamic_pointer_cast<U>(mThisPointer.lock());
00095     }

const std::string& bbtk::BlackBoxDescriptor::GetTypeName (  )  const [inline, inherited]

Returns the name of the **TYPE** of the black box.

Definition at line 90 of file bbtkBlackBoxDescriptor.h.

Referenced by GetHelp(), InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected().

00090 { return mTypeName; }

Here is the caller graph for this function:

long bbtk::Object::GetUseCount (  )  [inline, inherited]

Definition at line 63 of file bbtkObject.h.

00063 { return mThisPointer.use_count(); }

void bbtk::ComplexBlackBoxDescriptor::InsertHTMLGraph ( std::ofstream &  s,
int  detail,
int  level,
const std::string &  output_dir = "",
bool  relative_link = false 
)

Generates a png image representing the pipeline graph of the complex box and writes html code to insert it into the output file stream. detail : level : depth of nested complex boxes graph development (0:only this box level output_dir is the directory in which to write the files (.dot/.png/.cmap)

Definition at line 317 of file bbtkComplexBlackBoxDescriptor.cxx.

References mPrototype.

Referenced by InsertHtmlHelp().

00320   {
00321     this->mPrototype->bbInsertHTMLGraph( s, 
00322                                          detail, level, 
00323                                          false, 
00324                                          output_dir,
00325                                          relative_link );
00326   }

Here is the caller graph for this function:

void bbtk::ComplexBlackBoxDescriptor::InsertHtmlHelp ( std::ofstream &  s,
int  detail,
int  level,
const std::string &  output_dir = "",
bool  relative_link = false 
) [virtual]

Writes html formatted help into the output file stream. detail and level are used for graphical representation of complex black boxes (see ComplexBlackBox::InsertHTMLGraph) output_dir is the directory in which to write auxilliary files (.dot/.png/.cmap)

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 330 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtk::BlackBoxDescriptor::GetAuthor(), bbtk::BlackBoxDescriptor::GetCategory(), bbtk::BlackBoxDescriptor::GetDescription(), bbtk::BlackBoxDescriptor::GetInputDescriptorMap(), bbtk::BlackBoxDescriptor::GetOutputDescriptorMap(), GetScriptFileName(), bbtk::BlackBoxDescriptor::GetTypeName(), bbtk::Utilities::html_format(), InsertHTMLGraph(), mPrototype, and bbtk::Utilities::SplitString().

00333   {
00334     bbtkDDebugMessage("kernel",9,
00335                       "ComplexBlackBoxDescriptor::InsertHtmlHelp()"
00336                        <<std::endl);
00337     
00338     //-------------
00339     // General info 
00340     std::string name = GetTypeName();
00341     Utilities::html_format(name);
00342 
00343     //   std::ofstream* s = &s1;
00344 
00345     (s) << "<p><hr>\n";
00346     (s) << "<a name=\""<<name<<"\"></a>\n";
00347     (s) << //"Top:&nbsp;
00348       "<a rel=\"top\" accesskey=\"t\" href=\"#Top\">Top</a>\n";
00349     // (s) << "Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
00350     // (s) << "Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
00351     (s) << "<h2 class=\"section\">"<<name<<"</h2>\n";
00352 
00353 
00354     std::string descr = GetDescription();
00355     //Utilities::html_format(descr);
00356     
00357     std::string author = GetAuthor();
00358     Utilities::html_format(author);
00359     
00360     std::vector<std::string> categories;
00361     // Split the category string 
00362     std::string delimiters = ";,";
00363     Utilities::SplitString(GetCategory(),
00364                            delimiters,categories);
00365 
00366         
00367     (s) << "<p><TABLE cellspacing=0  cellpadding=3>\n";
00368     (s) << "<TR><TD style='vertical-align: top;'><b> Description </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> " 
00369         << descr << "</TD></TR>\n";
00370 
00371     (s) << "<TR><TD style='vertical-align: top;'><b> Author(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  " 
00372         << author << "</TD></TR>\n";
00373 
00374     (s) << "<TR><TD style='vertical-align: top;'><b> Category(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  ";
00375     std::vector<std::string>::iterator ci;
00376     for (ci=categories.begin(); ci!=categories.end(); ++ci)
00377       {
00378         s << "<a href=\"../index-category.html#"<< *ci <<"\">" << *ci 
00379           << "</a>&nbsp;\n";
00380       }
00381     s << "</TD></TR>\n";      
00382     std::string inc = GetScriptFileName();
00383     if (inc.size()>0) 
00384       {
00385         s << "<TR><TD style='vertical-align: top;'><b> To use it </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> include ";
00386         // s << inc << "&nbsp;&nbsp;<a href=\"../../../bbs/"<<inc<<"\">[source]</a>";
00387         // LG TODO : USE PACKAGE BBS PATH
00388         s << inc << "&nbsp;&nbsp;<a href=\""<<inc<<"\">[source]</a>";
00389         s << "</TD></TR>\n";
00390         
00391       }
00392     
00393     const ComplexBlackBox::BlackBoxMapType& B = mPrototype->bbGetBlackBoxMap();
00394         
00395     if (B.size()) 
00396     {
00397            (s) << "<TR><TD style='vertical-align: top;'><b> Uses </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  ";
00398 
00399            std::set<BlackBoxDescriptor::Pointer> pdeps;
00400            ComplexBlackBox::BlackBoxMapType::const_iterator b;
00401            for ( b = B.begin(); b != B.end(); ++b ) 
00402            {
00403              BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor();
00404               if (pdeps.find(d) != pdeps.end()) 
00405             continue;
00406               pdeps.insert(d);
00407 
00408               Package::Pointer p = d->GetPackage();
00409             
00410               std::string name = b->second->bbGetTypeName();
00411 
00412               std::string url;
00413               if (relative_link) 
00414                  url = p->GetDocRelativeURL();
00415               else 
00416                  url = p->GetDocURL();
00417                    
00418               s << "<a href=\"" <<url<<"#"<<name<<"\">" 
00419                 << p->GetName()<<"::"<<name<<"</a>\n";
00420             }   // for
00421         
00422             (s) << "</TD></TR>\n";
00423 
00424      } // If B.size
00425 
00426      (s) << "</TABLE>\n";
00427 
00428  
00429    //-------------
00430     // Graph
00431     InsertHTMLGraph( s , detail,level, output_dir, relative_link);
00432     
00433     //-------------
00434     // Inputs
00435     std::string col("#CCCCFF");
00436     
00437     //  (s) << "<h3 class=\"subsection\">Inputs</h3>\n";
00438     (s) << "<p><TABLE border=1 cellspacing=0 cellpadding=3>\n";
00439     (s) << "<TR><TD colspan=3 align=center bgcolor=\""<<col
00440       <<"\">Inputs</TD></TR>\n";
00441     const BlackBoxDescriptor::InputDescriptorMapType& imap = 
00442       GetInputDescriptorMap();
00443     
00444     InputDescriptorMapType::const_iterator in;
00445     
00446     for ( in = imap.begin();  in != imap.end(); ++in ) 
00447       {
00448         std::string name(in->second->GetName());
00449         Utilities::html_format(name);
00450         
00451         std::string type("<");
00452         type += in->second->GetTypeName();    
00453         type += ">";
00454         Utilities::html_format(type);
00455         
00456         std::string descr(in->second->GetDescription());
00457         //Utilities::html_format(descr);
00458 
00459 /*EED 10/11/2009
00460         (s) << "<TR><TD style='vertical-align: top;'><B><PRE> "<<name<<" </PRE></B></TD>"
00461           << "<TD style='vertical-align: top;'><I><PRE> "<<type<<" </PRE></I></TD>"
00462           << "<TD style='vertical-align: top;'>"<<descr<<"</TD></TR>\n";
00463 */
00464 
00465         (s) << "<TR><TD style='vertical-align: top;'><B><PRE> "<<name<<" </PRE></B></TD>"
00466           << "<TD style='vertical-align: top;'><I><PRE> "<<descr<<" </PRE></I></TD>"
00467           << "<TD style='vertical-align: top;'>"<<type<<"</TD></TR>\n";
00468         
00469       }
00470     //  (s) << "</TABLE>\n";
00471     
00472     
00473     //-------------
00474     // Outputs
00475     //  (s) << "<h3 class=\"subsection\">Outputs</h3>\n";
00476     //  (s) << "<TABLE border=1 cellspacing=0>\n";
00477     (s) << "<TR><TD colspan=3 align=center bgcolor=\""<<col
00478       <<"\">Outputs</TD></TR>\n";
00479     
00480     const BlackBoxDescriptor::OutputDescriptorMapType& omap = 
00481       GetOutputDescriptorMap();
00482     
00483     BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o;
00484     
00485     for ( o = omap.begin();  o != omap.end(); ++o ) 
00486       {
00487         std::string name(o->second->GetName());
00488         Utilities::html_format(name);
00489         
00490         std::string type("<");
00491         type += o->second->GetTypeName();    
00492         type += ">";
00493         Utilities::html_format(type);
00494         
00495         std::string descr(o->second->GetDescription());
00496         //Utilities::html_format(descr);
00497         
00498 /*EED 10/11/2009
00499         (s) << "<TR><TD style='vertical-align: top;'><B><PRE> "<<name<<" </PRE></B></TD>"
00500           << "<TD style='vertical-align: top;'><I><PRE> "<<type<<" </PRE></I></TD>"
00501           << "<TD style='vertical-align: top;'>"<<descr<<"</TD></TR>\n";
00502 */      
00503         (s) << "<TR><TD style='vertical-align: top;'><B><PRE> "<<name<<" </PRE></B></TD>"
00504           << "<TD style='vertical-align: top;'><I><PRE> "<<descr<<" </PRE></I></TD>"
00505           << "<TD style='vertical-align: top;'>"<<type<<"</TD></TR>\n";
00506 
00507       }
00508     (s) << "</TABLE>\n";
00509 
00510     //------------
00511     // End
00512 
00513 
00514    }

Here is the call graph for this function:

void bbtk::Object::InsertInObjectList ( Pointer  p  )  [static, inherited]

Definition at line 59 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

Referenced by bbtk::Object::MakePointer().

00060   { 
00061     bbtkDebugMessage("object",9,"##> Object::InsertInObjectList(\""
00062                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00063     boost::weak_ptr<Object> w(p);
00064     mgObjectList.insert(w); 
00065   }

Here is the caller graph for this function:

void bbtk::Object::InsertInPackageList ( Pointer  p  )  [static, inherited]

Definition at line 69 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgPackageList.

00070   { 
00071     bbtkDebugMessage("object",9,"##> Object::InsertInPackageList(\""
00072                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00073     boost::weak_ptr<Object> w(p);
00074     mgPackageList.insert(w); 
00075   }

void bbtk::Object::LockThis (  )  [inline, protected, inherited]

Definition at line 88 of file bbtkObject.h.

00088 { mThisPointerLocked = mThisPointer.lock(); }   

template<class U , class D >
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
const D &  del,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 115 of file bbtkObject.h.

References bbtk::Object::InsertInObjectList().

00118     {                                                                   
00119       if (s->mThisPointer.lock())                                       
00120         {                                                               
00121           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00122           if (!lock) s->mThisPointerLocked.reset();
00123           return p;
00124         }                                                               
00125       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,del);
00126       static_cast<D*>                                   
00127         (p._internal_get_deleter(typeid(D)))            
00128         ->mPointer = p;                                                 
00129       s->mThisPointer = p;                                              
00130       Object::InsertInObjectList(p);                                    
00131       if (lock) s->LockThis();                                          
00132       return p;                                                 
00133     }                                                                   

Here is the call graph for this function:

template<class U >
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 97 of file bbtkObject.h.

References bbtk::Object::InsertInObjectList().

Referenced by ComplexBlackBoxDescriptor(), bbtk::Executer::Executer(), bbtk::Interpreter::Init(), bbtk::Transcriptor::New(), bbtk::Package::New(), bbtk::InterpreterVirtual::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), bbtk::Executer::New(), and New().

00098     {                                                                   
00099       if (s->mThisPointer.lock())                                       
00100         {                                                               
00101           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00102           if (!lock) s->mThisPointerLocked.reset();
00103           return p;
00104         }                                                               
00105       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,Object::Deleter());
00106       static_cast<Object::Deleter*>                                     
00107         (p._internal_get_deleter(typeid(Object::Deleter)))              
00108         ->mPointer = p;                                                 
00109       s->mThisPointer = p;                                              
00110       Object::InsertInObjectList(p);                                    
00111       if (lock) s->LockThis();                                          
00112       return p;                                                 
00113     }                                                                   

Here is the call graph for this function:

Here is the caller graph for this function:

ComplexBlackBoxDescriptor::Pointer bbtk::ComplexBlackBoxDescriptor::New ( const std::string &  name  )  [static]

Definition at line 52 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDebugMessage, ComplexBlackBoxDescriptor(), and bbtk::Object::MakePointer().

Referenced by ComplexBlackBoxDescriptor().

00053   {
00054     bbtkDebugMessage("object",1,"##> ComplexBlackBoxDescriptor::New(\""<<name<<"\")"<<std::endl);
00055     ComplexBlackBoxDescriptor::Pointer p = 
00056       MakePointer(new ComplexBlackBoxDescriptor(name));
00057     bbtkDebugMessage("object",1,"<## ComplexBlackBoxDescriptor::New(\""<<name<<"\")"<<std::endl);
00058     return p;
00059   }

Here is the call graph for this function:

Here is the caller graph for this function:

BlackBox::Pointer bbtk::ComplexBlackBoxDescriptor::NewBlackBox ( const std::string &  name  )  [virtual]

Releases the descriptor.

Creates an instance of name <name> of the ComplexBlackBox of which this is the descriptor.

Gets the factory used (const) Creates an instance of name <name> of the ComplexBlackBox of which this is the descriptor

Implements bbtk::BlackBoxDescriptor.

Definition at line 99 of file bbtkComplexBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and mPrototype.

Referenced by Add().

00100   {
00101     bbtkDDebugMessage("kernel",5,
00102                       "ComplexBlackBoxDescriptor::NewBlackBox(\""
00103                       <<name<<"\")"
00104                       <<std::endl);
00105     
00106     return mPrototype->bbClone(name);
00107 
00108 
00109   }

Here is the caller graph for this function:

void bbtk::ComplexBlackBoxDescriptor::PrintBlackBoxes (  ) 

Definition at line 309 of file bbtkComplexBlackBoxDescriptor.cxx.

References mPrototype.

00310   {
00311     mPrototype->bbPrintBlackBoxes(); 
00312   }

void bbtk::Object::PrintObjectInfo ( const Pointer o  )  [static, inherited]

Definition at line 180 of file bbtkObject.cxx.

Referenced by bbtk::Object::PrintObjectListInfo().

00181   {
00182     std::cout << "* [" << p << "] \t" 
00183               << p.use_count()-1 << " r \t"
00184               << p->GetObjectRecursiveSize() << " ("
00185               << p->GetObjectSize() << ") b \t"
00186               << p->GetObjectName() 
00187               << std::endl;
00188     std::cout << p->GetObjectInfo();
00189   }

Here is the caller graph for this function:

void bbtk::Object::PrintObjectListInfo ( const std::string &  name  )  [static, inherited]

Definition at line 105 of file bbtkObject.cxx.

References bbtk::i, bbtk::Object::mgObjectList, and bbtk::Object::PrintObjectInfo().

Referenced by bbtk::Interpreter::commandDebug().

00106   {
00107     
00108     std::cout 
00109       << "=============== Living bbtk::Object pointers ========="<<std::endl;
00110 
00111     long n = 0;
00112     long u = 0;
00113     size_t m = 0;
00114     ObjectListType::iterator i;
00115     for (i = mgObjectList.begin();
00116          i!=mgObjectList.end();
00117          ++i)
00118       {
00119         if (i->use_count() == 0) 
00120           {
00121             u++;
00122           }
00123         else 
00124           { 
00125             Object::Pointer p(i->lock());
00126             if (p->GetObjectName().find(name) != std::string::npos ) 
00127               {
00128                 std::cout << n << "/" << mgObjectList.size() << " ";
00129                 PrintObjectInfo(p);
00130                 m += p->GetObjectSize();
00131                 n++;
00132               }
00133           }
00134       }
00135     std::cout 
00136       << "------------------------------------------------------"<<std::endl; 
00137 
00138     std::cout << " Total : "<<n<<" objects - "<<m<<" b"<<std::endl;
00139     if (u==1)
00140       {
00141         std::cout<<"* Note : "<<u
00142                  <<" object in list has 0 ref count, "
00143                  <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
00144       }
00145     else if (u>1)
00146       {
00147         std::cout<<"* Note : "<<u
00148                  <<" objects in list have 0 ref count, "
00149                  <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
00150       }
00151     std::cout
00152       << "============ EO Living bbtk::Object pointers ========="<<std::endl;
00153         
00154   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Object::ReleasePackages (  )  [static, inherited]

Definition at line 222 of file bbtkObject.cxx.

References bbtkDebugMessage, bbtk::i, bbtk::Object::mgPackageList, and bbtk::Package::Release().

Referenced by bbtk::StaticInitTime::~StaticInitTime().

00223   {
00224     bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl);
00225     // Release package pointers
00226     ObjectListType::iterator i;
00227     for (i = mgPackageList.begin();
00228          i!= mgPackageList.end();
00229          ++i)
00230       {
00231         if (i->use_count() != 0) 
00232           { 
00233             bbtkDebugMessage("object",1,"##> Releasing package '"<<
00234                              i->lock()->GetThisPointer<Package>()->GetName()
00235                              <<"'"<<std::endl);
00236             //      Object::Pointer p(i->lock());
00237             Package::WeakPointer w(i->lock()->GetThisPointer<Package>());
00238             Package::Release(w);
00239             /*
00240             if (p->GetObjectName().find(name) != std::string::npos ) 
00241               {
00242                 std::cout << n << "/" << mgObjectList.size() << " ";
00243                 PrintObjectInfo(p);
00244                 m += p->GetObjectSize();
00245                 n++;
00246               }
00247             */
00248           }
00249       }  
00250 
00251   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::ComplexBlackBoxDescriptor::Remove ( const std::string &  name,
bool  remove_connections = true 
)

Removes a black box from the complex box.

Definition at line 152 of file bbtkComplexBlackBoxDescriptor.cxx.

References mPrototype.

00154   {    
00155     mPrototype->bbRemoveBlackBox(name,remove_connections);
00156   }

void bbtk::Object::RemoveFromObjectList ( WeakPointer  p  )  [static, inherited]

Definition at line 80 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

Referenced by bbtk::Object::Deleter::operator()().

00081   { 
00082     bbtkDebugMessage("object",9,"##> Object::RemoveFromObjectList()"
00083                      <<std::endl);
00084     mgObjectList.erase(p);
00085 
00086   }

Here is the caller graph for this function:

void bbtk::ComplexBlackBoxDescriptor::SetFactory ( Factory::Pointer  f  )  [inline]

Sets the factory used.

Definition at line 67 of file bbtkComplexBlackBoxDescriptor.h.

00067 { mFactory = f; }

void bbtk::BlackBoxDescriptor::SetKind ( Kind  kind  )  [inline, inherited]

Sets the kind of box.

Definition at line 143 of file bbtkBlackBoxDescriptor.h.

00143 { mKind = kind; }

void bbtk::BlackBoxDescriptor::SetPackage ( PackagePointer  package  )  [inline, inherited]

Sets the Package to which the box belongs.

Definition at line 140 of file bbtkBlackBoxDescriptor.h.

00140 { mPackage = package; }

void bbtk::ComplexBlackBoxDescriptor::SetScriptFileName ( const std::string &  n  )  [inline]

Sets the name of the script file from which it is defined.

Definition at line 109 of file bbtkComplexBlackBoxDescriptor.h.

00109 { mScriptFileName = n; }

void bbtk::BlackBoxDescriptor::SetTypeName ( const std::string &  name  )  [inline, inherited]

Sets the name of the **TYPE** of BlackBox.

Definition at line 128 of file bbtkBlackBoxDescriptor.h.

Referenced by ComplexBlackBoxDescriptor().

00128 { mTypeName=name; }

Here is the caller graph for this function:

void bbtk::Object::UnLockThis (  )  [inline, protected, inherited]

Definition at line 89 of file bbtkObject.h.

00089 { mThisPointerLocked = Pointer(); }


Friends And Related Function Documentation

friend class ComplexBlackBox [friend]

Definition at line 63 of file bbtkComplexBlackBoxDescriptor.h.

friend struct Object::Deleter [friend]

Reimplemented from bbtk::BlackBoxDescriptor.

Definition at line 60 of file bbtkComplexBlackBoxDescriptor.h.


Member Data Documentation

std::string bbtk::BlackBoxDescriptor::mAuthor [protected, inherited]

The author of the black box.

Definition at line 175 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToAuthor().

std::string bbtk::BlackBoxDescriptor::mCategory [protected, inherited]

The category of the black box.

Definition at line 177 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToCategory().

std::string bbtk::BlackBoxDescriptor::mDescription [protected, inherited]

The description of the black box.

Definition at line 173 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToDescription().

The factory used.

Definition at line 157 of file bbtkComplexBlackBoxDescriptor.h.

Kind bbtk::BlackBoxDescriptor::mKind [protected, inherited]

The kind of box (standard / adaptor).

Definition at line 179 of file bbtkBlackBoxDescriptor.h.

The Package to which the box belongs.

Definition at line 181 of file bbtkBlackBoxDescriptor.h.

The name of the script file from which it was created.

Definition at line 161 of file bbtkComplexBlackBoxDescriptor.h.

std::string bbtk::BlackBoxDescriptor::mTypeName [protected, inherited]

The name of the type of black box.

Definition at line 171 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::GetFullTypeName().


The documentation for this class was generated from the following files:

Generated on Thu May 31 14:14:13 2012 for BBTK by  doxygen 1.5.7.1