> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/loadplugin_8h_source.md).

# loadplugin.h

[Go to the documentation of this file.](/s-adk-5.1-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/loadplugin_8h.md)

```cpp
 1 // -*- mode: C++ -*-
 2 #ifndef LOADPLUGIN_H_20180928
 3 #define LOADPLUGIN_H_20180928
 4 
 5 #include <utility>
 6 #include <vector>
 7 #include <string>
 8 
 9 #include "sdiplugin.h"
 10 #include "csd.h"
 11 #include "msr/msr.h"
 12 
 13 // ID of the vos3-cards plugin
 14 #define VOS3_CARDS_PLUGIN_ID 0xE1
 15 
 16 typedef enum
 17 {
 18  TRIGGER_TYPE_UNKNOWN,
 19  TRIGGER_TYPE_SINGLE,
 20  TRIGGER_TYPE_MULTIPLE,
 21  TRIGGER_TYPE_SEQUENCIAL
 22 } TRIGGER_TYPE;
 23 
 24 typedef enum
 25 {
 26  PLUGIN_READ_NONE,
 27  PLUGIN_READ_FIRST,
 28  PLUGIN_READ_NEXT
 29 } PLUGIN_READ_TYPE;
 30 
 32 class SDIPluginCtx
 33 {
 34  SDIPlugin *m_p;
 35  void *m_handle;
 36  std::string m_file;
 37  std::string m_name;
 38  std::string m_version;
 39  std::string m_pciversion;
 41  // disable copy constructor and assign operator
 42  SDIPluginCtx(const SDIPluginCtx&);
 43  SDIPluginCtx& operator=(const SDIPluginCtx&);
 44 #if __cplusplus >= 201103L // since C++11 also forbid usage of move
 45  SDIPluginCtx(const SDIPluginCtx&&);
 46  SDIPluginCtx& operator=(SDIPluginCtx&&);
 47 #endif
 48 
 49  public:
 50  SDIPluginCtx(): m_p(0), m_handle(0) { }
 51  SDIPluginCtx(const std::string &file): m_p(0), m_handle(0)
 52  {
 53  load(file);
 54  }
 55  virtual ~SDIPluginCtx()
 56  {
 57  unload();
 58  }
 59 
 63  bool load(const std::string &file);
 66  inline bool loaded() const
 67  {
 68  return !!m_handle;
 69  }
 71  void unload();
 74  const std::string &getFile() const
 75  {
 76  return m_file;
 77  }
 80  const std::string &getName() const
 81  {
 82  return m_name;
 83  }
 86  const std::string &getVersion() const
 87  {
 88  return m_version;
 89  }
 92  const std::string &getPciVersion() const
 93  {
 94  return m_pciversion;
 95  }
 98  SDIPlugin *getObj()
 99  {
 100  return m_p;
 101  }
 102 };
 103 
 121 const std::vector<SDIPluginCtx *> &loadPlugins(bool reload = true);
 122 
 126 const std::vector<SDIPluginCtx *>& getLoadedPlugins();
 127 
 133 void registerPlugin(SDIPluginCtx *p);
 134 
 144 SDIPluginCtx * unregisterPlugin(const std::string &filename);
 145 
 146 SDIPlugin* getPlugin(int pluginID);
 147 
 148 void handlePluginCmd(unsigned short msgBufSize, unsigned char *msg, unsigned short msgSize, unsigned short rspBufSize, unsigned char *rsp, unsigned short *rspSize);
 149 
 150 int executeSequencialTrigger(SDIPlugin::SDITrigger triggerID, PLUGIN_READ_TYPE readType, unsigned char *msg, unsigned short msgSize, unsigned short resBufSize, unsigned char *res, unsigned short *resSize);
 151 
 152 void storePluginMsrData(MSR_TrackData4 &tracks, MSR_DecodedData4 &decoded);
 153 
 155 struct bcTriggerResult
 156 {
 157  int retval;
 158  SDIPlugin::Buffer result;
 159  std::string name;
 160  int id;
 161 };
 162 
 163 void broadcastTriggerLocal(SDIPlugin::SDITrigger triggerID, csd::csd_data &message, std::vector<struct bcTriggerResult> &results);
 164 
 173 void broadcastTrigger(SDIPlugin::SDITrigger triggerID, csd::csd_data &message, std::vector<struct bcTriggerResult> &results);
 174 
 175 int executeSingleTrigger(SDIPlugin::SDITrigger triggerID, unsigned char *msg, unsigned short msgSize, unsigned short resBufSize, unsigned char *res, unsigned short *resSize);
 176 
 177 
 181 SDIPlugin* pluginInstalledForTrigger(SDIPlugin::SDITrigger triggerID);
 182 
 183 #endif
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/loadplugin_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
