Butterneck
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # CharmfulLemur :::info **Solitamente le variabili private e i metodi privati li chiamo \_nome con l'underscore davanti in modo da riconoscerli sempre ad occhio**. ::: :::info Nelle liste metti prima le cose pubbliche e poi le cose private possibilmente in ordine alfabetico o raggruppate logicamente. ::: :::warning Per ora la visibilita' e' messa abbastanza a caso e metodi e proprieta' sono messi in modo informe, ma il tutto prendera' forma una volta messi giu' piu' pezzi della gerarchia possibili. ::: :::warning **Warning:** Per ora niente e' segnato come costante/statico, questa distinzione **va fatta**. ::: ## Diagramma delle Classi ```mermaid graph TB ConfigLayer([ConfigLayer]) BaseImage([BaseImage]) Cpu([Cpu]) -.-> Scalable{{Scalable}} Gpu([Gpu]) -.-> Scalable Ram([Ram]) -.-> Scalable DB([DB]) -.-> Scalable NFS([NFS]) -.-> Scalable DB -.-> Storage{{Storage}} NFS -.-> Storage{{Storage}} subgraph OS BaseImage ConfigLayer end subgraph VM OS Cpu Gpu Ram end subgraph DataBases DB end subgraph NetworkFS NFS end subgraph Application VM DataBases NetworkFS end style Scalable stroke-width:2px, stroke-dasharray: 5, 5 style Storage stroke-width:2px, stroke-dasharray: 5, 5 style Application color: red style VM color: green style DataBases color: blue style NetworkFS color: orange ``` ## List(Container) - *template* List(Container) e' un template di classe in grado di contenere al suo interno un numero *teoricamente* illimitato di oggetti omogenei. Il container e' in grado di comportarsi come una coda *FIFO*, e come un piu' generico vettore. ### Metodi |visibilita' | nome |tipo |descrizione |-|-|-|-| ### Operatori - [ ] [copia]() - [ ] [copia profonda]() - [ ] [uguaglianza]() - [ ] [minore]() - [ ] [maggiore]() - [ ] [minore uguale]() - [ ] [maggiore uguale]() - [ ] [indicizzazione]() ## Iterator - *Container friend* Classe iteratore che e' in grado di accedere anche alla parte privata della classe container. <!-- CLASS DEFINITION --> ## Scalable - *viritual* La classe virtuale Scalable definisce un oggetto virtuale, che rappresenta un insieme di oggetti omogenei, che possono scalare. Va definito il modo in cui viene deciso come e quando devono scalare. |visibilita' | nome |tipo |descrizione |-|-|-|-| |**protected**| \_runningInstances | `int` | Numero di oggetti che sono contenuti nell'insieme |**protected**| \_minInstances|`int` | Numero minimo di oggetti contenuti nell'insieme |**protected**| \_maxInstances|`int` | Numero massimo di oggetti contenuti nell'insieme |**protected**| \_scaleUpFactor|`int` | Numero di oggetti che devono essere aggiunti all'insieme quando viene effettuato scaling-up |**protected**| \_scaleDownFactor|`int` | Numero di oggetti che devono essere rimossi all'insieme quando viene effettuato scaling-down |**protected**| \_upscalable|`boolean` | Definisce se all'insieme e' permesso fare scale-up |**protected**| \_downscalable|`boolean` | Definisce se all'insieme e' permesso fare scale-down |**protected**| \_upscaleThreshold | `int` | Soglia sopra cui viene eseguito lo scale-up |**protected**| \_downscaleThreshold | `int` | Soglia sotto cui viene eseguito lo scale-down ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor0) - [ ] [_checkStatus](#_checkStatus) ? - [ ] [_isDownScalable](#_isDownScalable) - [ ] [_isUpScalable](#_isUpScalable) - [ ] [_makeDownScalable](#makeDownScalable) - [ ] [_makeUpScalable](#_makeUpScalable) - [ ] [_scaleDown](#_scaleDown) - [ ] [_scaleUp](#_scaleUp) </td> <td> <!-- GETTERS --> <!-- - [ ] [getRunningInstances](#getRunningInstances) - [ ] [getLowerLimit](#getLowerLimit) - [ ] [getUpperLimit](#getUpperLimit) - [ ] [getLowerThreshold](#getLowerThreshold) - [ ] [getUpperThreshold](#getUpperThreshold) --> </td> <td> <!--SETTERS --> <!-- - [ ] [setRunningInstances](#setRunningInstances) - [ ] [setLowerLimit](#setLowerLimit) - [ ] [setUpperLimit](#setUpperLimit) - [ ] [setLowerThreshold](#setLowerThreshold) - [ ] [setUpperThreshold](#setUpperThreshold) --> </td> </tr> </table> ### constructor ```cpp= constructor() ``` > Descrizione del costruttore e dei parametri. ### _checkStatus :::warning **Nota:** Bisogna definire se il check dello stato va fatto interno o esterno alla classe. ::: ### _isDownScalable ```cpp= protected const bool _isDownScalable() = 0; ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se l'oggetto e' configurato per poter essere down-scalable, `false` altrimenti. ### _isUpScalable ```cpp= protected const bool _isUpScalable() = 0; ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se l'oggetto e' configurato per poter essere up-scalable, `false` altrimenti. ### _makeDownScalable ```cpp= protected void _makeDownScalable() = 0; ``` > Tautologico. > > **params:** > > > **return: `void`** ### _makeUpScalable ```cpp= protected void _makeUpScalable() = 0; ``` > Tautologico. > > **params:** > > > **return: `void`** ### _scaleDown ```cpp= protected void _scaleDown() = 0; ``` > Decrementa il numero di istanze correnti dell'oggetto in base allo scaleDownFactor impostato o del numero esatto per raggiungere minInstances nel caso in cui instances-scaleDownFactor\<minInstances. > > **params:** > > > **return: `void`** ### _scaleUp ```cpp= protected void _scaleUp() = 0; ``` > Aumenta il numero di istanze correnti dell'oggetto in base allo scaleUpFactor impostato o del numero esatto per raggiungere maxInstances nel caso in cui instances+scaleUpFactor>maxInstances. > > **params:** > > > **return: `void`** <!-- CLASS DEFINITION --> ## Storage - *virtual* La classe virtuale Storage definisce un oggetto virtuale che rappresenta una generica unita' di storage. Delle unita' di storage in particolare si possono effettuare backup (totali o parziali) dei dati, o automaticamente, a cadenza regolare, o manualmente; possono essere condivisi tra piu' applicazioni ?(forse troppo complicato) e **ALTRE COSE CHE CI DEVONO VENIRE MENTE** che generalmente le unita' di storage fanno. :::danger La classe **non** e' completa, serve farsi venire delle buone idee per aggiungere funzionalita'. ::: :::warning **Warning:** Va definito con piu' precisione cosa fanno i backup parziali. ::: |visibilita' | nome |tipo |descrizione |-|-|-|-| |**protected**| \_backupInterval|`int` | Numero di ore ogni cui bisogna fare il backup |**protected**| \_backupLock|`boolean` | Lock per l'esecuzione dei backup |**protected**| \_lastBackupDate | `date` | Data (e ora) dell'ultimo backup |**protected**| \_recurrentBackup|`boolean` | Definisce se il backup va fatto regolarmente |**protected**| \_recurrentBackupType|`enum` | Definisce il tipo di backup che si vuole effettuare (parziale o totale) ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) - [ ] [backup](#backup) - [ ] [fullBackup](#fullBackup) - [ ] [isRecurrentBackup](#isRecurrentBackup) - [ ] [partialBackup](#partialBackup) - [ ] [_backupIsLocked](#backupIsLocked) </td> <td> <!-- GETTERS --> <!-- - [ ][getBackupInterval](#getBackupInterval) - [ ][getLastBackupDate](#getLastBackupDate) - [ ][isRecurrentBackup](#isRecurrentBackup) - [ ][getRecurrentBackupType](#getRecurrentBackupType) --> </td> <td> <!--SETTERS --> <!-- - [ ][setBackupInterval](#setBackupInterval) - [ ][setRecurrentBackup](#setRecurrenBackup) - [ ][_setRecurrentBackupType](#setRecurrentBackupType) --> </td> </tr> </table> ### constructor ```cpp= constructor() { } ``` ### backup ```cpp= protected void backup() = 0; ``` > Effettua il backup dell'unita' di storage secondo la configurazione. > > **params:** > > > **return: `void`** ### fullBackup ```cpp= protected void fullBackup() = 0; ``` > Effettua il backup totale dell'unita' di storage. > > **params:** > > **return: `void`** ### isRecurrentBackup ```cpp= protected const bool isRecurrentBackup() = 0; ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se l'unita' e' impostata per fare il backup automatico ricorrente, `false` altrimenti. ### partialBackup ```cpp= protected void partialBackup() = 0; ``` > Effettua il backup parziale dell'unita' di storage. > > **params:** > > > **return: `void`** ### _backupIsLocked ```cpp= protected const bool _backupIsLocked() = 0; ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se sta venendo eseguito un backup, `false` altrimenti. <!-- CLASS DEFINITION --> ## Application - _concrete_ - _encapsulation_ La classe Application rappresenta una applicazione. Una applicazione e' la combinazione di [VM](#VM), [DB](#DB) e [NFS](#NFS). Una applicazione non deve obbligatoriamente essere composta da tutte e tre le componenti sopra citate, ma da una qualsiasi combinazione di queste, con l'unico obbligo di contenerne almeno una. |visibilita' | nome |tipo |descrizione |-|-|-|-| |**private**| \_dbs | `container`<[DB](#DB)> | Insieme dei DB gestiti dall'applicazione |**private**| \_nfss| `container`<[NFS](#NSF)| Insieme degli NFS gestiti dall'applicazione |**private**| \_vms | `container`<[VM](#VM)> | Insieme delle VM gestite dall'applicazione ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) - [ ] [getConfiguration](#getConfiguration) - [ ] [deployConfiguration](#deployConfiguration) - [ ] [addDB](#addDB) - [ ] [addNFS](#addNFS) - [ ] [addVM](#addVM) </td> <td> <!-- GETTERS --> <!-- - [ ] [](#) --> </td> <td> <!--SETTERS --> <!-- - [ ] [](#) --> </td> </tr> </table> ### constructor ```cpp= constructor() { } ``` ### getConfiguration ```cpp= public const string getConfiguration() { } ``` > Restituisce la configurazione dell'applicazione, e' quindi la raccolta e la formalizzazione di tutte le configurazioni fatte con l'interfaccia grafica. > > **params:** > > > **return: `string`** > > > Configurazione delle parti dell'applicazione sotto forma di stringa :::info Molto probabilmente non sara' compito suo ritornare una stringa, questa funzione infatti credo dovra' ritornare un oggetto particolare che poi una opportuna classe _exporter_ si occupera' di trasformare in stringa a seconda del formato scelto. ::: ### deployConfiguration ```cpp= public void deployConfiguration() { } ``` > Esegue il deploy dell'applicazione secondo la configurazione specificata > > **params:** > > > **return: `void`** ### addDB ```cpp= public void addDB(DB db) { } ``` > Aggiunge il DB db alla configurazione > > **params:** > > > `DB db`: configurazione di DB da aggiungere all'applicazione > > > **return: `void`** ### addNFS ```cpp= public void addNFS(NFS nfs) { } ``` > Aggiunge l'NFS nfs alla configurazione > > **params:** > > > `NFS nfs`: configurazione di NFS da aggiungere all'applicazione > > > **return: `void`** ### addVM ```cpp= public void addVM(VM vm) { } ``` > Aggiunge la VM vm alla configurazione > > **params:** > > > `VM vm`: configurazione di VM da aggiungere all'applicazione > > > **return: `void`** <!-- CLASS DEFINITION --> ## Cpu - *concrete*: private Scalable La classe Cpu rappresenta l'insieme di vCore assegnati ad una VM. L'insieme e' scalabile come denota la derivazione dalla classe [Scalable](#Scalable). Implementa tutti i metodi virtuali della classe da cui deriva. Con [RamCluster](#RamCluster) e [Os](#Os) e' una delle parti indispensabili per la creazione di una [VM](#VM). <!-- CLASS DEFINITION --> ## ConfigLayer - *concrete* Classe che rappresenta un layer di configurazione. Un layer di configurazione non e' altro che una stringa che rappresenta una serie di comandi *(i.e. apt update -y && apt install vim)*. Nonostante sia solamente una stringa viene creata una classe a parte per maggiore riusabilita' e per una maggiore definizione delle entita'. |visibilita' | nome |tipo |descrizione |-|-|-|-| |**protected**| \_config | `string` | Insieme di comandi da eseguire ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) </td> <td> <!-- GETTERS --> <!-- - [ ] [](#) --> </td> <td> <!--SETTERS --> <!-- - [ ] [](#) --> </td> </tr> </table> ### constructor ```cpp= constructor() { } ``` <!-- CLASS DEFINITION --> ## DB La classe DB rappresenta un insieme di DataBase assegnati ad una applicazione. L'insieme e' scalabile, come denota la derivazione dalla classe [Scalable](#Scalable). Il comportamento di scaling di questa classe e' duplice: puo' scalare in dimensione se si sta esaurendo lo spazio assegnato, oppure puo' scalare in numero, ovvero puo' duplicarsi se il carico di IO e' troppo alto per il numero di istanze esistenti. Non e' necessario instanziare un DB per poter creare una Applicazione, e una applicazione puo' anche essere composta solamente da DB. Una Applicazione puo' contenere piu' DB. ## GPU - _concrete_ La classe GPU rappresenta l'insieme di vCoreG(_raphics_) assegnati ad una VM. L'insieme e' scalabile come denota la derivazione dalla classe [Scalable](#Scalable). Implementa tutti i metodi virtuali della classe da cui deriva. Non e' necessario allocare risorse di questo tipo per poter creare una [VM](#VM) ## NFS <!-- CLASS DEFINITION --> ## Os - *concrete* La classe Os e' chiamata in modo improprio in questo modo, questa classe infatti rappresenta la configurazione di docker image che puo' essere installata in una VM. Il altre parole rappresenta il _dockerfile_. La classe e' in grado di eseguire il build di questa immagine e di caricarla nel proprio account in DockerHub. |visibilita' | nome |tipo |descrizione |-|-|-|-| |**private**| \_baseImage | `string` | Nome dell'immagine di partenza |**private**| \_buildLock | `boolean` | Lock per il build |**private**| \_configLayers | `container`<[ConfigLayer](#ConfigLayer)> | Array di layer di configurazione |**private**| \_dockerhubUsername | `string` | Username DockerHub |**private**| \_dockerhubPassword | `string` | Password DockerHub |**private**| \_lastBuildConfigHash| `string`| Hash della configurazione usata per l'ultima build eseguita con successo ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) - [ ] [addConfigLayer](#addConfigLayer) - [ ] [buildContainer](#buildContainer) - [ ] [isBuilding](#isBuilding) - [ ] [isBuilt](#isBuilt) - [ ] [_runConfigLayer](#_runConfigLayer) </td> <td> <!-- GETTERS --> - [ ] [getDockerfile](#getDockerfile) - [ ] [_getConfigHash](#getConfigHash) </td> <td> <!--SETTERS --> <!-- - [ ] [](#) --> </td> </tr> </table> ### constructor ```cpp= constructor() { } ``` ### addConfigLayer ```cpp= public void addConfigLayer(char* config) { } ``` > Aggiunge un layer alla configurazione. > > **params:** > > > **`char* config`**: Comandi da eseguire nel layer > > >**return: `void`** ### buildContainer ```cpp= public void buildContainer() { } ``` > Esegue il build di una immagine docker secondo la configurazione dell'oggetto di invocazione; dopodiche' carica l'immagine su un docker registry. > > **params:** > > > **return: `void`** ### getConfigHash ```cpp= private const char* getConfigHash() { } ``` > Ritorna un hash md5 del dockerfile generato dalla configurazione corrente. > > **params:** > > > **returns: `char*`** > > > Ritora un hash in formato md5 ### getDockerfile ```cpp= public const char* getDockerfile() { } ``` > Ritorna la configurazione dell'OS in formato dockerfile. > > **params:** > > > **returns: `char*`** > > > Il dockerfile generato sotto forma di stringa. ### isBuilding ```cpp= public const bool isBuilding() { } ``` > Tautologico. > > **params:** > > > **returns: `bool`** > > > Ritorna `true` se e' in corso l'esecuzione di una build della configurazione, `false` altrimenti. ### isBuilt ```cpp= public const bool isBuilt() { } ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se e' gia' stata eseguita una build della _esatta_ configurazione attuale, `false` altrimenti ### _runConfigLayer ```cpp= public const void _runConfigLayer(ConfigLayer* layer) { } ``` > Esegue i comandi definiti in `layer`. > **Da definire come gestire l'esecuzione dei layer: va qui o deve essere autocontenuta nella classe [ConfigLayer](#ConfigLayer)?** > > **params:** > > > `ConfigLayer* layer`: Il layer di cui eseguire i comandi > > > **return: `void`** <!-- CLASS DEFINITION --> ## Ram La classe Ram rappresenta il numero di GB assegnati ad una VM. L'insieme e' scalabile come denota la derivazione dalla classe [Scalable](#Scalable), ovvero il quantitativo di RAM puo' essere dinamicamente modificato. Implementa tutti i metodi virtuali della classe da cui deriva. Con [Cpu](#Cpu) e [Os](#Os) e' una delle parti indispensabili per la creazione di una [VM](#VM). <!-- CLASS DEFINITION --> ## Vm - *concrete* - *encapsulation* La classe VM rappresenta una Virtual Machine di cui e' stato fatto il deploy. Una Virtual Machine e' intesa come un orchestratore di risorse ([CpuCluster](#CpuCluster), [GpuCluster](#GpuCluster), [Os](#Os), [RamCluster](#RamCluster)). Alcune di queste risorse sono necessarie per la creazione di una VM ([CpuCluster](#Cpu), [RamCluster](#RamCluster) e [Os](#Os)), mentre altre sono opzionali ([GpuCluster](#GpuCluster)). La classe utilizza l'incapsulamento per contenere oggetti di tipi uguali alle risorse assegnatele. Non e' necessario instanziare una VM per poter creare una Applicazione, e una applicazione puo' anche essere composta solamente da VM. Una applicazione puo' contenere piu' VM. |visibilita' | nome |tipo |descrizione |-|-|-|-| |**private**| \_baseMem|`int` | Memoria di massa base assegnata alla VM (Molto piccola perche' costosa) |**private**| \_cpuCluster |[CpuCluster](#CpuCluster) | Insieme di Cpu |**private**| \_deployLock | `bool` | Lock per deploy |**private**| \_gpuCluster | [GpuCluster](#GpuCluster) | Insieme di Gpu |**private**| \_ramCluster |[RamCluster](#RamCluster) | Insieme di Ram |**private**| \_requiredUnits| `enum` | Lista delle unita' necessarie per la creazione di una VM |**private**| \_os |[Os](#Os) | Sistema operativo installato sulla VM ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) - [ ] [addCpuCluster](#addCpuCluster) - [ ] [addGpuCluster](#addGpuCluster) - [ ] [addOS](#addOS) - [ ] [addRamCluster](#addRamCluster) - [ ] [canRun](#canRun) - [ ] [deployVM](#deployVM) - [ ] [isBeingDeployed](#isBeingDeployed) - [ ] [isDeployed](#isDeployed) - [ ] [_hasBasicUnits](#_hasBasicUnits) </td> <td> <!-- GETTERS --> <!-- - [ ] [](#) --> </td> <td> <!--SETTERS --> <!-- - [ ] [](#) --> </td> </tr> </table> ### constructor ```cpp= constructor() { } ``` ### addCPUCluster ```cpp= public void addCpuCluster() { } ``` > Aggiunge alla VM un [CpuCluster](#CpuCluster). > > **params:** > > > **return: `void`** ### addGpuCluster ```cpp= public void addGpuCluster() { } ``` > Aggiunge alla VM un [GpuCluster](#GpuCluster). > > **params:** > > > **return: `void`** ### addOs ```cpp= public void addOs() { } ``` > Aggiunge alla VM un [Os](#Os). > > **params:** > > > **return: `void`** ### addRamCluster ```cpp= public void addRamCluster() { } ``` > Aggiunge alla VM un [RamCluster](#RamCluster). > > **params:** > > > **return: `void`** ### canRun ```cpp= public const bool canRun() { } ``` > Controlla se la macchina virtuale e' in grado di essere eseguita. Utilizzera' l'interfaccia privata ([_hasBasicUnits](#_hasBasicUnits), *altri controlli*) per definire se la macchina virtuale puo' essere eseguita, e quindi creata. Non e' possibile creare una macchina virtuale che non puo' essere eseguita. > > **params:** > > > **return: `void`** > > > `true` se la macchina virtuale soddisfa tutti i requisiti per essere eseguita, `false` atrimenti ### deployVM ```cpp= public void runVM() { } ``` > Esegue il deploy della Virtual Machine. Prima di fare il deploy controlla che la VM sia avviabile. > > **params:** > > > **return: `void`** ### isBeingDeployed ```cpp= public const bool isBeingDeployed() { } ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se sta venendo eseguito il deploy della VM, `false` altrimenti ### isDeployed ```cpp= public const bool isDeployed() { } ``` > Tautologico. > > **params:** > > > **return: `bool`** > > > Ritorna `true` se e' la VM e' in stato di deploy, `false` altrimenti ### _hasBasicUnits ```cpp= private const bool _hasBasicUnit() { } ``` > Controlla se la macchina virtuale possiede le unita' di base necessarie per essere inizializzata. Queste sono [CpuCluster](#CpuCluster), [RamCluster](#RamCluster) e [Os](#Os). > > **params:** > > > **return: `boolean`** > > > `true` se la macchina virtuale possiede tutte le unita', `false` altrmenti. ## Utils da fare copia-incolla |visibilita' | nome |tipo |descrizione |-|-|-|-| |**private**| \_cpu |[Cpu](#Cpu) | Insieme di Cpu |**private**| \_gpu | [Gpu](#Gpu) | Insieme di Gpu |**private**| \_ram |[Ram](#Ram) | Insieme di Ram |**private**| \_os |[Os](#Os) | Sistema operativo installato sulla VM |**private**| \_baseMem|int | Memoria di massa base assegnata alla VM (Molto piccola perche' costosa) ### Metodi <table> <tr> <th> Generics </th> <th> Getters </th> <th> Setters </th> </tr> <tr> <td> <!-- GENERICS --> - [ ] [constructor](#constructor) </td> <td> <!-- GETTERS --> - [ ] [](#) </td> <td> <!--SETTERS --> - [ ] [](#) </td> </tr> </table>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully