<commit_before>/*
 * Copyright (c) 2007 Digital Bazaar, Inc.  All rights reserved.
 */
#ifndef db_modest_Module_H
#define db_modest_Module_H

#include "db/modest/ModuleInterface.h"
#include "db/rt/Exception.h"
#include <string>

namespace db
{
namespace modest
{

// forward declare Kernel
class Kernel;

typedef struct ModuleId
{
   /**
    * The unique name of this Module.
    */
   char* name;
   
   /**
    * The version (major.minor) of this Module.
    */
   char* version;
   
   /**
    * Creates a ModuleId with the specified name and version.
    * 
    * @param name the name for the ModuleId.
    * @param version the version (major.minor) for the ModuleId.
    */
   ModuleId(const char* name = "", const char* version = "")
   {
      name = strdup(name);
      version = strdup(version);
   }
   
   /**
    * Destructs this ModuleId.
    */
   ~ModuleId()
   {
      delete [] name;
      delete [] version;
   }
};

/**
 * A Module is any extension to Modest. It can be loaded into an instance of
 * Modest run its available Operations. It can also create and provide new
 * Operations for other Modules to run.
 * 
 * @author <NAME>
 */
class Module
{
public:
   /**
    * Creates a new Module.
    */
   Module() {};
   
   /**
    * Destructs this Module.
    */
   virtual ~Module() {};
   
   /**
    * Gets the ID of this Module.
    * 
    * @return the ID of this Module.
    */
   virtual const ModuleId& getId() = 0;
   
   /**<commit_msg>Removed code that copied name/version for ModuleId. The memory is now assumed to be static (via const char*).<commit_after>/*
 * Copyright (c) 2007 Digital Bazaar, Inc.  All rights reserved.
 */
#ifndef db_modest_Module_H
#define db_modest_Module_H

#include "db/modest/ModuleInterface.h"
#include "db/rt/Exception.h"
#include <string>

namespace db
{
namespace modest
{

// forward declare Kernel
class Kernel;

/**
 * A ModuleId contains a name and version for a Module. The name and version
 * are stored as const char*'s and are assumed to point to static memory.
 * 
 * @author <NAME>
 */
typedef struct ModuleId
{
   /**
    * The unique name of this Module.
    */
   const char* name;
   
   /**
    * The version (major.minor) of this Module.
    */
   const char* version;
   
   /**
    * Creates a ModuleId with the specified name and version.
    * 
    * @param name the name for the ModuleId.
    * @param version the version (major.minor) for the ModuleId.
    */
   ModuleId(const char* name = "", const char* version = "")
   {
      name = name;
      version = version;
   }
};

/**
 * A Module is any extension to Modest. It can be loaded into an instance of
 * Modest run its available Operations. It can also create and provide new
 * Operations for other Modules to run.
 * 
 * @author <NAME>
 */
class Module
{
public:
   /**
    * Creates a new Module.
    */
   Module() {};
   
   /**
    * Destructs this Module.
    */
   virtual ~Module() {};
   
   /**
    * Gets the ID of this Module.
    * 
    * @return the ID of this Module.
    */
   virtual const ModuleId& getId() = 0;
   
   /**
{'fraction_non_alphanumeric': 0.11463730569948187, 'fraction_numerical': 0.003238341968911917, 'mean_word_length': 2.357608695652174, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6861502', 'n_tokens_mistral': 988, 'n_tokens_neox': 962, 'n_words': 350}