!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/include/gdcm-3.0/   drwxr-xr-x
Free 13.05 GB of 57.97 GB (22.51%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     gdcmCommand.h (5.02 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*=========================================================================

  Program: GDCM (Grassroots DICOM). A DICOM library

  Copyright (c) 2006-2011 Mathieu Malaterre
  All rights reserved.
  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#ifndef GDCMCOMMAND_H
#define GDCMCOMMAND_H

#include "gdcmSubject.h"

namespace gdcm
{
class Event;

/**
 * \brief Command superclass for callback/observer methods
 * \see Subject
 */
class GDCM_EXPORT Command : public Subject
{
public :
  Command(const Command&) = delete;
  void operator=(const Command&) = delete;

  /// Abstract method that defines the action to be taken by the command.
  virtual void Execute(Subject *caller, const Event & event ) = 0;

  /** Abstract method that defines the action to be taken by the command.
   * This variant is expected to be used when requests comes from a
   * const Object
   */
  virtual void Execute(const Subject *caller, const Event & event ) = 0;

protected:
  Command();
  ~Command() override;
};

/** \class MemberCommand
 *  \brief Command subclass that calls a pointer to a member function
 *
 *  MemberCommand calls a pointer to a member function with the same
 *  arguments as Execute on Command.
 *
 */
template <class T>
class MemberCommand : public Command
{
public:

  /** pointer to a member function that takes a Subject* and the event */
  typedef  void (T::*TMemberFunctionPointer)(Subject*, const Event &);
  typedef  void (T::*TConstMemberFunctionPointer)(const Subject*,
                                                  const Event &);

  /** Standard class typedefs. */
  typedef MemberCommand       Self;
  //typedef SmartPointer<Self>  Pointer;

  MemberCommand(const Self&) = delete;
  void operator=(const Self&) = delete;

  /** Method for creation through the object factory. */
  static SmartPointer<MemberCommand> New()
    {
    return new MemberCommand;
    }

  /** Run-time type information (and related methods). */
  //gdcmTypeMacro(MemberCommand,Command);

  /**  Set the callback function along with the object that it will
   *  be invoked on. */
  void SetCallbackFunction(T* object,
                           TMemberFunctionPointer memberFunction)
    {
    m_This = object;
    m_MemberFunction = memberFunction;
    }
  void SetCallbackFunction(T* object,
                           TConstMemberFunctionPointer memberFunction)
    {
    m_This = object;
    m_ConstMemberFunction = memberFunction;
    }

  /**  Invoke the member function. */
  void Execute(Subject *caller, const Event & event ) override
    {
    if( m_MemberFunction )
      {
      ((*m_This).*(m_MemberFunction))(caller, event);
      }
    }

  /**  Invoke the member function with a const object. */
  void Execute( const Subject *caller, const Event & event ) override
    {
    if( m_ConstMemberFunction )
      {
      ((*m_This).*(m_ConstMemberFunction))(caller, event);
      }
    }

protected:

  T* m_This;
  TMemberFunctionPointer m_MemberFunction;
  TConstMemberFunctionPointer m_ConstMemberFunction;
  MemberCommand():m_MemberFunction(nullptr),m_ConstMemberFunction(nullptr) {}
  ~MemberCommand() override= default;

};

/** \class SimpleMemberCommand
 *  \brief Command subclass that calls a pointer to a member function
 *
 *  SimpleMemberCommand calls a pointer to a member function with no
 *  arguments.
 */
template <typename T>
class SimpleMemberCommand : public Command
{
public:

  /** A method callback. */
  typedef  void (T::*TMemberFunctionPointer)();

  /** Standard class typedefs. */
  typedef SimpleMemberCommand   Self;
  //typedef SmartPointer<Self>    Pointer;

  SimpleMemberCommand(const Self&) = delete;
  void operator=(const Self&) = delete;

  /** Run-time type information (and related methods). */
  //gdcmTypeMacro(SimpleMemberCommand,Command);

  /** Method for creation through the object factory. */
  static SmartPointer<SimpleMemberCommand> New()
    {
    return new SimpleMemberCommand;
    }

  /** Specify the callback function. */
  void SetCallbackFunction(T* object,
                           TMemberFunctionPointer memberFunction)
    {
    m_This = object;
    m_MemberFunction = memberFunction;
    }

  /** Invoke the callback function. */
  void Execute(Subject *,const Event & ) override
    {
    if( m_MemberFunction )
      {
      ((*m_This).*(m_MemberFunction))();
      }
    }
  void Execute(const Subject *,const Event & ) override
    {
    if( m_MemberFunction )
      {
      ((*m_This).*(m_MemberFunction))();
      }
    }

protected:
  T* m_This;
  TMemberFunctionPointer m_MemberFunction;
  SimpleMemberCommand():m_This(nullptr),m_MemberFunction(nullptr) {}
  ~SimpleMemberCommand() override = default;
};

} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif //GDCMCOMMAND_H

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0092 ]--