Logo Khaganat

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
fr:packed_sheets [2017/01/30 10:04] – démarage trad fr osquallofr:packed_sheets [2021/12/03 18:19] (Version actuelle) – modification externe 127.0.0.1
Ligne 4: Ligne 4:
 ====== Packed sheet ====== ====== Packed sheet ======
 <WRAP info> <WRAP info>
-Je ne sais pas si les infos sont deja sur le wiki (pas sous ce nom en tout cas et rien vu d'approchant dans les titres) et que je pense que ca peut aider je vais  le mettre ici et le trad en français.+Je ne sais pas si les infos sont déjà sur le wiki (pas sous ce nom en tout cas et rien vu d'approchant dans les titres) et que je pense que ça peut aider je vais le mettre ici et le trad en français.
  
 Et au pire on peux toujours l’enlever si c'est déjà décrit ailleurs. Et au pire on peux toujours l’enlever si c'est déjà décrit ailleurs.
Ligne 13: Ligne 13:
 </WRAP> </WRAP>
  
 +Un "[[packed sheets]]" est une façon de stocker plusieurs "[[George sheet]]" dans un format binaires. Ce qu'un [[packed sheet]] fait c'est charger tous les  sheet/forms dans un seul fichier binaires qui peux être sérializer par un "loader" qui peut automatiquement le remplir avec les bonnes données. Il va aussi mettre à jour le "[[packed_sheets]]" (si on lui dit de le faire) pour également créer un nouveau sheet (si il n'existe pas déjà) ou ajouter une nouvelle entrée dans un "[[packed_sheets]] existant. 
  
-A packed sheet is a way of storing multiple Georges sheets in a binary format. What a packed sheet does is load all of the sheets/forms into a single binary file that can be serialized by a loader that can automatically populate the proper data. It also will update the packed sheet (if informed to) to either create a new packed sheet (if one does not already exist) or add new entries to a packed sheet. 
-Process of Loading 
  
-For packed sheets, you must declare a class that will be used by the form packer:+===== Processus de chargement =====
  
-===== Create a class (or struct) that is needed to conform to the following interface: ======+Pour un "[[packed_sheets]]", vous devez déclarer une classe qui va être utiliser par le  "form paker": 
 + 
 +==== Créer une class ( ou struct ) qui dis se conformer a l'interface suivante: =====
  
 <code cpp> <code cpp>
Ligne 28: Ligne 29:
      /**      /**
  
-      * \brief Here you read in the form if necessarystoring it in members of the TMyLoader class+      * \brief Ici vous pouvez lire dans le form si nécessaireles stocker dans les membres de la classe TMyLoader si nécessaire.
  
       */       */
Ligne 37: Ligne 38:
      /**      /**
  
-      * \brief Here you write a standard NeL serial for all the member of TMyLoader that need to be packed.+      * \brief Ici vous écrivez un "Nel serial" standart pour tous les membres de TMyLoader qui doivent être empaquetés.
  
       */       */
Ligne 46: Ligne 47:
      /**      /**
  
-      * \brief This method returns the version of the packed sheet.+      * \brief Cette méthode renvoi la version du Packed sheet.
  
-      * The coder needs to increment the number each time the packed sheet changes and the serial method+      * Le codeur dois augmenter ce nombre à chaque fois que le packed sheet change et que la methode de sérialisation  
 +      * est mise à jour pour que le code supprime les vieux Packed sheets.
  
       * is updated so the code will discard old packed sheets.       * is updated so the code will discard old packed sheets.
Ligne 54: Ligne 56:
       *       *
  
-      * \return uint This must always return an integerUnsigned is probably best.+      * \return uint Cela dois toujours renvoyer un entierNon-signé "unsigned" est probablement le mieux.
  
       */       */
Ligne 62: Ligne 64:
  
      /**      /**
 +     
 +      * \brief Ici vous pouvez écrire du code personnalisé pour le moment ou le loader dosi supprime de vieux packed sheets.
  
-      * \brief Here you can write custom code for when the packed sheet loader needs to remove an old sheet. +      * \note Rarement utilisé.
- +
-      * \note This is rarely used.+
  
       */       */
Ligne 74: Ligne 76:
 </code> </code>
  
-Loader Structure/Class Notes+=== Loader Structure/Class Notes ===
  
-    A good example of a packed sheet loader is CSoundSerializer in sound_bank.cpp +  * Un bon exemple de "Packed sheet loader" est CSoundSerializer dans sound_bank.cpp 
-    readGeorges would do something like load variables in from the sheet using UFormElm'and the like and then use that data to create a new objectIt essentially is form loading\+  * ReadGeorges devrai faire quelques chose comme charger les variables depuis le sheet en utilisant UFormElm'et compagnie et ensuite utiliser ces données pour créer un nouvel objetC'est essentiellement un chargeur de "Form".  
-    serial is basic NeL serializationThis is for when loadForm wants to save or load the loader structure from a streamIt's the same thing as readGeorges except you're doing f.serial(myVar); instead of myVar=root.getValueByName(".MyVar"); Examples of serialization are everywhere in NeL. +  * Serial est la sérialisation de base du NeL. C'est pour le moment ou loadForm veux sauvegarder ou charger la structure du "loader" depuis un fluxC'est la même chose que readGeorge excepté que vous faite un f.serial(myVar); au lieu de myVar=root.getValueByName(".MyVar");. Des exemple de sérialisation sont partout dans le NeL.  
-    removed() is called when the loadForm update cycle determines that the file that created this particular object is no longer in the file systemEssentially it just clears the members of the class as a destructor would+  * Removed() est appelé quand le cycle de mise à jour du loader détermine que le fichier qui a crée cet objet particulier n'est plus dans le systèmeEssentiellement il va juste nettoyer les membre de la class comme le ferai un destructeur
-    getVersion() just tells the version number of the sheets. Any time you change the loader structure/class or the sheet forms for this loader you will want to increment the version number so that old versions of sheets get dropped from the packed sheetThis is very important.+  getVersion() donne simplement le numéro de version des sheets. Chaque fois que le loader ou que le sheet form pour ce loader  est modifié vous devrez incrémenter ce numéro de sorte que les anciennes versions du sheets soit retiré du packed_sheetC'est très important.
  
-Now that you have your class that conforms to the requirements of the packer and loader you have to create a container for the form loader to populate with sheetsThis must always be like a map similar to the one below.+Maintenant que vous avez une classe conforme au prérequis des packer et loader vous devez créer un containeur pour que le "form loader" le remplisse de "sheet"Cela dois toujours être comme un "map" similaire à celui qui suit.
  
-===== Declare a container for all the loaded sheets: =====+Now that you have your class that conforms to the requirements of the packer and loader you have to create a conteneur for the form loader to populate with sheets. This must always be like a map similar to the one below. 
 + 
 +===== Déclarer un conteneur pour tous les "sheets" chargés: =====
  
 <code cpp>std::map<CSheetId, TMyLoader> MySheets;</code> <code cpp>std::map<CSheetId, TMyLoader> MySheets;</code>
  
-Usually Nevrax declares this globally but there is no constraint about that. It is used for single call to loadForm (which is described belowand not for all sheets in an application. This method loads all of the sheets into the container.+Habituellement Nevrax déclare cela globalement mais il n'aucune contraintes à ce propos.  C'est utilisé pour un seul appel à loadForm (décris plus baset non pour tous les "sheets" de l'application. Cette méthode charge tous les "sheets" du conteneur.
  
-===== Call the packed sheet loader: =====+ 
 +==== Appel du "packed sheet loader": ====
  
 <code cpp>loadForm( "my_extension", "packed_sheet_file_name.packed_sheets", MySheets, true);</code> <code cpp>loadForm( "my_extension", "packed_sheet_file_name.packed_sheets", MySheets, true);</code>
  
-Essentially what loadForm does is if told to go through the files with my_extension for an extension and check if there are newer ones than in the packed sheet, new ones periodor if some have been removed and marks these files appropriately in memoryIt then loads all of the forms and puts them into cached lists and removes any files it found missing from the packed sheetIf it changed the container at all (added new filesupdated changed filesor removed old filesit saves the file back out as the file passed in the parameterwhich is packed_sheet_file_name.packed_sheets in the above exampleIn the process your map will be populated either via serialization (unchanged sheets) or by the readGeorges method (added or updated sheets.+Essentielement ce que loadForm fait est d'aller a travers les fichier avec my_extension comme extensionet vérifier si il y en à des plus récent que ceux dans le "[[packed sheets]]"ou si certains ont été supprimé et les marquer de façon approprié en mémoireensuite elle charge touts les Forms et les met dans la list de cache et supprime les fichiers trouvé manquant dans le "[[packed sheets]]"Si il a changé le conteneur (ajouter de nouveau fichiermis d'autre à jourou supprimé les vieux fichiersil sauvegarde le fichier en retour comme le fichier passé en paramètresqui est packed_sheet_file_name.packed_sheets dans l'exemple précédentDans le processus votre "map" va être remplie soit par la sérialisation (sheets inchangésoit par la méthode readGeorges (ajout ou mises à jour).  
-Loading Notes+ 
 +=== Notes sur le chargement ===
  
 The packed sheet form loader requires that the file extension be .packed_sheets - however the logic lets you get away with .packed_sheetsbar for example. As a matter of practice though the packed sheet extension should stay with the standard. The packed sheet form loader requires that the file extension be .packed_sheets - however the logic lets you get away with .packed_sheetsbar for example. As a matter of practice though the packed sheet extension should stay with the standard.
Ligne 106: Ligne 112:
 loadForm is a template function, as seen above it will deduce it's argument from the ''container'' paramenter, where you will pass ))MySheets((. loadForm is a template function, as seen above it will deduce it's argument from the ''container'' paramenter, where you will pass ))MySheets((.
  
-Summary Details+===== Résumé Détails =====
  
 As you have defined you own class to hold packed data, and as you declared you own container to hold them (in fact, the container MUST be a std::map<CSheetId, you_class> ), then it's easy to access the container with a valid sheet id to retreive your data As you have defined you own class to hold packed data, and as you declared you own container to hold them (in fact, the container MUST be a std::map<CSheetId, you_class> ), then it's easy to access the container with a valid sheet id to retreive your data
CC Attribution-Share Alike 4.0 International Driven by DokuWiki
fr/packed_sheets.1485770678.txt.gz · Dernière modification : (modification externe)

Licences Mentions légales Accueil du site Contact Inclusion